mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 17:31:36 +00:00
move proxy fallback away from send method
This commit is contained in:
parent
c1fa13d0f6
commit
da9351260c
2 changed files with 4 additions and 8 deletions
|
@ -190,14 +190,7 @@ class HttpStratumInterface(PollingInterface):
|
|||
import urllib2, json, time, cookielib
|
||||
|
||||
if self.proxy:
|
||||
# This is a friendly fallback to the old style default proxy options
|
||||
if(self.proxy["mode"] == "none"):
|
||||
simple_config = SimpleConfig()
|
||||
simple_config.set_key("proxy", None, True)
|
||||
return
|
||||
|
||||
import socks
|
||||
|
||||
socks.setdefaultproxy(proxy_modes.index(self.proxy["mode"]), self.proxy["host"], int(self.proxy["port"]) )
|
||||
socks.wrapmodule(urllib2)
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ from util import user_dir
|
|||
|
||||
class SimpleConfig:
|
||||
|
||||
|
||||
default_options = {
|
||||
"gui": "lite",
|
||||
"proxy": None,
|
||||
|
@ -26,6 +25,10 @@ class SimpleConfig:
|
|||
os.mkdir(self.config_folder)
|
||||
self.save_config()
|
||||
|
||||
# This is a friendly fallback to the old style default proxy options
|
||||
if(self.config.get("proxy") is not None and self.config["proxy"]["mode"] == "none"):
|
||||
self.set_key("proxy", None, True)
|
||||
|
||||
def set_key(self, key, value, save = True):
|
||||
self.config[key] = value
|
||||
if save == True:
|
||||
|
|
Loading…
Add table
Reference in a new issue