From b367ad0560bb1a91e836f6d18f0014b6232538d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=B4=E5=A8=83=E9=85=B1?= Date: Sat, 7 Jan 2017 01:23:42 +0800 Subject: [PATCH] using '#' to split multi-user setting --- shadowsocks/obfsplugin/auth.py | 2 +- shadowsocks/tcprelay.py | 18 ++++++++++-------- shadowsocks/udprelay.py | 18 ++++++++++-------- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/shadowsocks/obfsplugin/auth.py b/shadowsocks/obfsplugin/auth.py index 8edd6a0..4150aaa 100644 --- a/shadowsocks/obfsplugin/auth.py +++ b/shadowsocks/obfsplugin/auth.py @@ -1131,7 +1131,7 @@ class auth_aes128_sha1(auth_base): def set_server_info(self, server_info): self.server_info = server_info try: - max_client = int(server_info.protocol_param) + max_client = int(server_info.protocol_param.split('#')[0]) except: max_client = 64 self.server_info.data.set_max_client(max_client) diff --git a/shadowsocks/tcprelay.py b/shadowsocks/tcprelay.py index 763122d..8db91f9 100644 --- a/shadowsocks/tcprelay.py +++ b/shadowsocks/tcprelay.py @@ -1020,14 +1020,16 @@ class TCPRelay(object): self._listen_port = listen_port if config['protocol'] in ["auth_aes128_md5", "auth_aes128_sha1"]: - user_list = config['protocol_param'].split(',') - if user_list: - for user in user_list: - items = user.split(':') - if len(items) == 2: - uid = struct.pack('