Browse Source

fix str type

akkariiin/dev
AkaneAkaza 7 years ago
parent
commit
23fea5e329
  1. 2
      server_pool.py
  2. 4
      shadowsocks/server.py

2
server_pool.py

@ -117,7 +117,7 @@ class ServerPool(object):
else:
a_config = self.config.copy()
a_config.update(user_config)
if len(a_config['server_ipv6']) > 2 and a_config['server_ipv6'][0] == "[" and a_config['server_ipv6'][-1] == "]":
if len(a_config['server_ipv6']) > 2 and a_config['server_ipv6'][0] == b"[" and a_config['server_ipv6'][-1] == b"]":
a_config['server_ipv6'] = a_config['server_ipv6'][1:-1]
a_config['server'] = common.to_str(a_config['server_ipv6'])
a_config['server_port'] = port

4
shadowsocks/server.py

@ -108,8 +108,8 @@ def main():
(protocol, password, method, obfs, obfs_param))
if 'server_ipv6' in a_config:
try:
if len(a_config['server_ipv6']) > 2 and a_config['server_ipv6'][0] == "[" and a_config['server_ipv6'][
-1] == "]":
if len(a_config['server_ipv6']) > 2 and a_config['server_ipv6'][0] == b"[" and a_config['server_ipv6'][
-1] == b"]":
a_config['server_ipv6'] = a_config['server_ipv6'][1:-1]
a_config['server_port'] = int(port)
a_config['password'] = password

Loading…
Cancel
Save