scrapinghub / slackbot

A chat bot for Slack (https://slack.com).
MIT License
1.26k stars 396 forks source link

add code to fix the proxy setting #178

Closed AceBee007 closed 4 years ago

AceBee007 commented 6 years ago

in a local network which is connected to a proxy server, if the os.environ['http_proxy'] is 'http://proxy.server.address:8080/' and the code is:

proxy, proxy_port = 'http://proxy.server.address:8080/'.split(':')

the error would be appear as:

ValueError: too many values to unpack (excepted 2)

To fix this bug I prefer to use rsplit(':, 1'). And proxy should not be written with 'http://', so I fixed it.

kiaka010 commented 5 years ago

Whats the status on this?
I noticed that currently the http_proxy does not allow username:password@proxy.com:8080 but my guess is this rsplit would fix this too

AceBee007 commented 5 years ago

Added a function get_proxy_setting() into utils.py and changed codes of proxy setting part.

lins05 commented 4 years ago

Closed in 21ad0c8775e92f50cc2c21ec46f737273f9d4209.