Added support for socks4 and socks5 proxies. New Python packages must be installed, see readme for more information

This commit is contained in:
Jose Manuel Delicado 2017-01-16 11:13:51 +01:00
parent 2370c39c15
commit 8a701c450e
2 changed files with 13 additions and 3 deletions

View File

@ -68,10 +68,12 @@ setuptools installs a script, called easy_install. You can find it in the python
* markdown
* winpaths
* microsofttranslator
* PySocks
* win_inet_pton
easy_install will automatically get the additional libraries that these packages need to work properly.
Run the following command to quickly install and upgrade all packages and their dependencies:
easy_install -Z --upgrade six configobj goslate markdown future suds requests oauthlib requests-oauthlib requests-toolbelt pypubsub==3.3.0 pygeocoder arrow==0.6 python-dateutil futures microsofttranslator winpaths
easy_install -Z --upgrade six configobj goslate markdown future suds requests oauthlib requests-oauthlib requests-toolbelt pypubsub==3.3.0 pygeocoder arrow==0.6 python-dateutil futures microsofttranslator winpaths PySocks win_inet_pton
#### Other dependencies

View File

@ -17,7 +17,15 @@ def patched_session_init(self):
orig_session_init(self)
if config.app["proxy"]["server"] != "" and config.app["proxy"]["port"] != "":
self.proxies={"http":"http://{0}:{1}/".format(config.app["proxy"]["server"], config.app["proxy"]["port"]),
"https": "https://{0}:{1}/".format(config.app["proxy"]["server"], config.app["proxy"]["port"])}
"https": "https://{0}:{1}/".format(config.app["proxy"]["server"], config.app["proxy"]["port"]),
"http": "socks5://{0}:{1}/".format(config.app["proxy"]["server"], config.app["proxy"]["port"]),
"https": "socks5://{0}:{1}/".format(config.app["proxy"]["server"], config.app["proxy"]["port"])
"http": "socks4://{0}:{1}/".format(config.app["proxy"]["server"], config.app["proxy"]["port"]),
"https": "socks4://{0}:{1}/".format(config.app["proxy"]["server"], config.app["proxy"]["port"])}
if config.app["proxy"]["user"] != "" and config.app["proxy"]["password"] != "":
self.proxies={"http": "http://{0}:{1}@{2}:{3}/".format(config.app["proxy"]["user"], config.app["proxy"]["password"], config.app["proxy"]["server"], config.app["proxy"]["port"]),
"https": "https://{0}:{1}@{2}:{3}/".format(config.app["proxy"]["user"], config.app["proxy"]["password"], config.app["proxy"]["server"], config.app["proxy"]["port"])}
"https": "https://{0}:{1}@{2}:{3}/".format(config.app["proxy"]["user"], config.app["proxy"]["password"], config.app["proxy"]["server"], config.app["proxy"]["port"])
"http": "socks5://{0}:{1}@{2}:{3}/".format(config.app["proxy"]["user"], config.app["proxy"]["password"], config.app["proxy"]["server"], config.app["proxy"]["port"]),
"https": "socks5://{0}:{1}@{2}:{3}/".format(config.app["proxy"]["user"], config.app["proxy"]["password"], config.app["proxy"]["server"], config.app["proxy"]["port"]),
"http": "socks4://{0}:{1}@{2}:{3}/".format(config.app["proxy"]["user"], config.app["proxy"]["password"], config.app["proxy"]["server"], config.app["proxy"]["port"]),
"https": "socks4://{0}:{1}@{2}:{3}/".format(config.app["proxy"]["user"], config.app["proxy"]["password"], config.app["proxy"]["server"], config.app["proxy"]["port"])}