[Mod]remove default proxy setting

This commit is contained in:
vn.py 2019-04-09 11:27:12 +08:00
parent 0260aa0784
commit f53f5ea7dd
3 changed files with 21 additions and 7 deletions

View File

@ -71,8 +71,8 @@ class BitmexGateway(BaseGateway):
"Secret": "", "Secret": "",
"会话数": 3, "会话数": 3,
"服务器": ["REAL", "TESTNET"], "服务器": ["REAL", "TESTNET"],
"代理地址": "127.0.0.1", "代理地址": "",
"代理端口": 1080, "代理端口": "",
} }
def __init__(self, event_engine): def __init__(self, event_engine):
@ -91,6 +91,11 @@ class BitmexGateway(BaseGateway):
proxy_host = setting["代理地址"] proxy_host = setting["代理地址"]
proxy_port = setting["代理端口"] proxy_port = setting["代理端口"]
if proxy_port.isdigit():
proxy_port = int(proxy_port)
else:
proxy_port = 0
self.rest_api.connect(key, secret, session_number, self.rest_api.connect(key, secret, session_number,
server, proxy_host, proxy_port) server, proxy_host, proxy_port)

View File

@ -73,8 +73,8 @@ class HuobiGateway(BaseGateway):
"API Key": "", "API Key": "",
"Secret Key": "", "Secret Key": "",
"会话数": 3, "会话数": 3,
"代理地址": "127.0.0.1", "代理地址": "",
"代理端口": 1080, "代理端口": "",
} }
def __init__(self, event_engine): def __init__(self, event_engine):
@ -95,6 +95,11 @@ class HuobiGateway(BaseGateway):
proxy_host = setting["代理地址"] proxy_host = setting["代理地址"]
proxy_port = setting["代理端口"] proxy_port = setting["代理端口"]
if proxy_port.isdigit():
proxy_port = int(proxy_port)
else:
proxy_port = 0
self.rest_api.connect(key, secret, session_number, self.rest_api.connect(key, secret, session_number,
proxy_host, proxy_port) proxy_host, proxy_port)
self.trade_ws_api.connect(key, secret, proxy_host, proxy_port) self.trade_ws_api.connect(key, secret, proxy_host, proxy_port)

View File

@ -74,8 +74,8 @@ class OkexGateway(BaseGateway):
"Secret Key": "", "Secret Key": "",
"Passphrase": "", "Passphrase": "",
"会话数": 3, "会话数": 3,
"代理地址": "127.0.0.1", "代理地址": "",
"代理端口": 1080, "代理端口": "",
} }
def __init__(self, event_engine): def __init__(self, event_engine):
@ -94,9 +94,13 @@ class OkexGateway(BaseGateway):
proxy_host = setting["代理地址"] proxy_host = setting["代理地址"]
proxy_port = setting["代理端口"] proxy_port = setting["代理端口"]
if proxy_port.isdigit():
proxy_port = int(proxy_port)
else:
proxy_port = 0
self.rest_api.connect(key, secret, passphrase, self.rest_api.connect(key, secret, passphrase,
session_number, proxy_host, proxy_port) session_number, proxy_host, proxy_port)
self.ws_api.connect(key, secret, passphrase, proxy_host, proxy_port) self.ws_api.connect(key, secret, passphrase, proxy_host, proxy_port)
def subscribe(self, req: SubscribeRequest): def subscribe(self, req: SubscribeRequest):