From 24623b896dfeadc80a09f0f4a0a3493df0237c9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=B4=E5=A8=83=E9=85=B1?= Date: Sat, 20 May 2017 14:50:27 +0800 Subject: [PATCH] fix str type --- shadowsocks/server.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/shadowsocks/server.py b/shadowsocks/server.py index f4dfdd5..c18ad1c 100755 --- a/shadowsocks/server.py +++ b/shadowsocks/server.py @@ -29,7 +29,7 @@ if __name__ == '__main__': sys.path.insert(0, os.path.join(file_path, '../')) from shadowsocks import shell, daemon, eventloop, tcprelay, udprelay, \ - asyncdns, manager + asyncdns, manager, common def main(): @@ -86,16 +86,16 @@ def main(): bindv6 = config.get("out_bindv6", '') if type(password_obfs) == list: password = password_obfs[0] - obfs = password_obfs[1] + obfs = common.to_str(password_obfs[1]) if len(password_obfs) > 2: - protocol = password_obfs[2] + protocol = common.to_str(password_obfs[2]) elif type(password_obfs) == dict: password = password_obfs.get('password', config_password) - method = password_obfs.get('method', method) - protocol = password_obfs.get('protocol', protocol) - protocol_param = password_obfs.get('protocol_param', protocol_param) - obfs = password_obfs.get('obfs', obfs) - obfs_param = password_obfs.get('obfs_param', obfs_param) + method = common.to_str(password_obfs.get('method', method)) + protocol = common.to_str(password_obfs.get('protocol', protocol)) + protocol_param = common.to_str(password_obfs.get('protocol_param', protocol_param)) + obfs = common.to_str(password_obfs.get('obfs', obfs)) + obfs_param = common.to_str(password_obfs.get('obfs_param', obfs_param)) bind = password_obfs.get('out_bind', bind) bindv6 = password_obfs.get('out_bindv6', bindv6) else: