Browse Source

rename bind -> out_bind

dev
BreakWa11 9 years ago
parent
commit
6906c7db04
  1. 12
      shadowsocks/server.py
  2. 6
      shadowsocks/tcprelay.py

12
shadowsocks/server.py

@ -70,8 +70,8 @@ def main():
protocol_param = config.get("protocol_param", '') protocol_param = config.get("protocol_param", '')
obfs = config.get("obfs", 'plain') obfs = config.get("obfs", 'plain')
obfs_param = config.get("obfs_param", '') obfs_param = config.get("obfs_param", '')
bind = config.get("bind", '') bind = config.get("out_bind", '')
bindv6 = config.get("bindv6", '') bindv6 = config.get("out_bindv6", '')
if type(password_obfs) == list: if type(password_obfs) == list:
password = password_obfs[0] password = password_obfs[0]
obfs = password_obfs[1] obfs = password_obfs[1]
@ -103,8 +103,8 @@ def main():
a_config['protocol_param'] = protocol_param a_config['protocol_param'] = protocol_param
a_config['obfs'] = obfs a_config['obfs'] = obfs
a_config['obfs_param'] = obfs_param a_config['obfs_param'] = obfs_param
a_config['bind'] = bind a_config['out_bind'] = bind
a_config['bindv6'] = bindv6 a_config['out_bindv6'] = bindv6
a_config['server'] = a_config['server_ipv6'] a_config['server'] = a_config['server_ipv6']
logging.info("starting server at [%s]:%d" % logging.info("starting server at [%s]:%d" %
(a_config['server'], int(port))) (a_config['server'], int(port)))
@ -124,8 +124,8 @@ def main():
a_config['protocol_param'] = protocol_param a_config['protocol_param'] = protocol_param
a_config['obfs'] = obfs a_config['obfs'] = obfs
a_config['obfs_param'] = obfs_param a_config['obfs_param'] = obfs_param
a_config['bind'] = bind a_config['out_bind'] = bind
a_config['bindv6'] = bindv6 a_config['out_bindv6'] = bindv6
logging.info("starting server at %s:%d" % logging.info("starting server at %s:%d" %
(a_config['server'], int(port))) (a_config['server'], int(port)))
tcp_servers.append(tcprelay.TCPRelay(a_config, dns_resolver, False)) tcp_servers.append(tcprelay.TCPRelay(a_config, dns_resolver, False))

6
shadowsocks/tcprelay.py

@ -138,8 +138,8 @@ class TCPRelayHandler(object):
self._protocol.set_server_info(server_info) self._protocol.set_server_info(server_info)
self._redir_list = config.get('redirect', ["0.0.0.0:0"]) self._redir_list = config.get('redirect', ["0.0.0.0:0"])
self._bind = config.get('bind', '') self._bind = config.get('out_bind', '')
self._bindv6 = config.get('bindv6', '') self._bindv6 = config.get('out_bindv6', '')
self._fastopen_connected = False self._fastopen_connected = False
self._data_to_write_to_local = [] self._data_to_write_to_local = []
@ -522,7 +522,7 @@ class TCPRelayHandler(object):
bind_addr = '' bind_addr = ''
if self._bind and af == socket.AF_INET: if self._bind and af == socket.AF_INET:
bind_addr = self._bind bind_addr = self._bind
elif self._bindv6 and af == socket.AF_INET: elif self._bindv6 and af == socket.AF_INET6:
bind_addr = self._bindv6 bind_addr = self._bindv6
else: else:
bind_addr = self._local_sock.getsockname()[0] bind_addr = self._local_sock.getsockname()[0]

Loading…
Cancel
Save