diff --git a/config.json b/config.json index 0d0d13e..ef4c79e 100644 --- a/config.json +++ b/config.json @@ -14,6 +14,7 @@ "obfs": "tls1.2_ticket_auth_compatible", "obfs_param": "", "speed_limit_per_con": 0, + "speed_limit_per_user": 0, "dns_ipv6": false, "connect_verbose_info": 0, diff --git a/shadowsocks/eventloop.py b/shadowsocks/eventloop.py index e36f858..6e2f22f 100644 --- a/shadowsocks/eventloop.py +++ b/shadowsocks/eventloop.py @@ -53,7 +53,7 @@ EVENT_NAMES = { } # we check timeouts every TIMEOUT_PRECISION seconds -TIMEOUT_PRECISION = 5 +TIMEOUT_PRECISION = 2 class KqueueLoop(object): diff --git a/shadowsocks/tcprelay.py b/shadowsocks/tcprelay.py index 7f2d3c9..fcaadb0 100644 --- a/shadowsocks/tcprelay.py +++ b/shadowsocks/tcprelay.py @@ -133,6 +133,7 @@ class TCPRelayHandler(object): self._client_address = local_sock.getpeername()[:2] self._accept_address = local_sock.getsockname()[:2] self._user = None + self._user_id = server._listen_port # TCP Relay works as either sslocal or ssserver # if is_local, this is sslocal @@ -238,6 +239,7 @@ class TCPRelayHandler(object): def _update_user(self, user): self._user = user + self._user_id = struct.unpack('