The proxy support should be fully functional now

This commit is contained in:
Jose Manuel Delicado
2017-01-16 15:49:49 +01:00
parent b7dd6d43fe
commit dab8be7c12
3 changed files with 12 additions and 17 deletions

View File

@@ -15,17 +15,9 @@ def fix():
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"]),
"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"]["server"] != "" and config.app["proxy"]["port"] != "" and config.app["proxy"]["type"] in config.proxyTypes:
self.proxies={"http":"{0}://{1}:{2}/".format(config.app["proxy"]["type"], config.app["proxy"]["server"], config.app["proxy"]["port"]),
"https": "{0}://{1}:{2}/".format(config.app["proxy"]["type"], 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"]),
"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"])}
self.proxies={"http": "{0}://{1}:{2}@{3}:{4}/".format(config.app["proxy"]["type"], config.app["proxy"]["user"], config.app["proxy"]["password"], config.app["proxy"]["server"], config.app["proxy"]["port"]),
"https": "{0}://{1}:{2}@{3}:{4}/".format(config.app["proxy"]["type"], config.app["proxy"]["user"], config.app["proxy"]["password"], config.app["proxy"]["server"], config.app["proxy"]["port"])}