diff --git a/shadowsocks/server.py b/shadowsocks/server.py index 40b040a..3547309 100755 --- a/shadowsocks/server.py +++ b/shadowsocks/server.py @@ -70,8 +70,8 @@ def main(): protocol_param = config.get("protocol_param", '') obfs = config.get("obfs", 'plain') obfs_param = config.get("obfs_param", '') - bind = config.get("bind", '') - bindv6 = config.get("bindv6", '') + bind = config.get("out_bind", '') + bindv6 = config.get("out_bindv6", '') if type(password_obfs) == list: password = password_obfs[0] obfs = password_obfs[1] @@ -103,8 +103,8 @@ def main(): a_config['protocol_param'] = protocol_param a_config['obfs'] = obfs a_config['obfs_param'] = obfs_param - a_config['bind'] = bind - a_config['bindv6'] = bindv6 + a_config['out_bind'] = bind + a_config['out_bindv6'] = bindv6 a_config['server'] = a_config['server_ipv6'] logging.info("starting server at [%s]:%d" % (a_config['server'], int(port))) @@ -124,8 +124,8 @@ def main(): a_config['protocol_param'] = protocol_param a_config['obfs'] = obfs a_config['obfs_param'] = obfs_param - a_config['bind'] = bind - a_config['bindv6'] = bindv6 + a_config['out_bind'] = bind + a_config['out_bindv6'] = bindv6 logging.info("starting server at %s:%d" % (a_config['server'], int(port))) tcp_servers.append(tcprelay.TCPRelay(a_config, dns_resolver, False)) diff --git a/shadowsocks/tcprelay.py b/shadowsocks/tcprelay.py index 254038c..7fa4f35 100644 --- a/shadowsocks/tcprelay.py +++ b/shadowsocks/tcprelay.py @@ -138,8 +138,8 @@ class TCPRelayHandler(object): self._protocol.set_server_info(server_info) self._redir_list = config.get('redirect', ["0.0.0.0:0"]) - self._bind = config.get('bind', '') - self._bindv6 = config.get('bindv6', '') + self._bind = config.get('out_bind', '') + self._bindv6 = config.get('out_bindv6', '') self._fastopen_connected = False self._data_to_write_to_local = [] @@ -522,7 +522,7 @@ class TCPRelayHandler(object): bind_addr = '' if self._bind and af == socket.AF_INET: bind_addr = self._bind - elif self._bindv6 and af == socket.AF_INET: + elif self._bindv6 and af == socket.AF_INET6: bind_addr = self._bindv6 else: bind_addr = self._local_sock.getsockname()[0]