From 3f66ec443f1f0b93993f2676e6cd4eb00fb19b30 Mon Sep 17 00:00:00 2001 From: BreakWa11 Date: Wed, 21 Oct 2015 22:37:32 +0800 Subject: [PATCH] remove FORCE_NEW_PROTOCOL --- shadowsocks/tcprelay.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/shadowsocks/tcprelay.py b/shadowsocks/tcprelay.py index 2bb973a..a51830a 100644 --- a/shadowsocks/tcprelay.py +++ b/shadowsocks/tcprelay.py @@ -30,11 +30,8 @@ import random from shadowsocks import encrypt, obfs, eventloop, shell, common from shadowsocks.common import pre_parse_header, parse_header -# set it 'False' to use both new protocol and the original shadowsocks protocal -# set it 'True' to use new protocol ONLY, to avoid GFW detecting -FORCE_NEW_PROTOCOL = False # set it 'True' if run as a local client and connect to a server which support new protocol -CLIENT_NEW_PROTOCOL = False +CLIENT_NEW_PROTOCOL = False #deprecated # we clear at most TIMEOUTS_CLEAN_SIZE timeouts each time TIMEOUTS_CLEAN_SIZE = 512 @@ -404,8 +401,6 @@ class TCPRelayHandler(object): if self._is_local: header_result = parse_header(data) else: - if data is None or FORCE_NEW_PROTOCOL and common.ord(data[0]) != 0x88 and (~common.ord(data[0]) & 0xff) != 0x88: - data = self._handel_protocol_error(self._client_address, ogn_data) data = pre_parse_header(data) if data is None: data = self._handel_protocol_error(self._client_address, ogn_data)