Browse Source

add protocol_param

dev
BreakWa11 9 years ago
parent
commit
c83341da9b
  1. 1
      config.json
  2. 19
      shadowsocks/tcprelay.py

1
config.json

@ -8,6 +8,7 @@
"timeout": 120,
"method": "aes-256-cfb",
"protocol": "auth_sha1_compatible",
"protocol_param": "",
"obfs": "http_simple_compatible",
"obfs_param": "",
"dns_ipv6": false,

19
shadowsocks/tcprelay.py

@ -274,15 +274,13 @@ class TCPRelayHandler(object):
return True
else:
try:
if self._is_local:
pass
else:
if self._encrypt_correct:
if sock == self._remote_sock:
if self._encrypt_correct:
self._server.server_transfer_ul += len(data)
elif self._encrypt_correct and (self._obfs is not None):
obfs_encode = self._obfs.server_encode(data)
data = obfs_encode
self._server.server_transfer_ul += len(data)
self._update_activity(len(data))
elif not self._is_local and self._obfs is not None:
obfs_encode = self._obfs.server_encode(data)
data = obfs_encode
if data:
l = len(data)
s = sock.send(data)
@ -597,7 +595,6 @@ class TCPRelayHandler(object):
self.destroy()
return
ogn_data = data
self._update_activity(len(data))
if not is_local:
if self._encryptor is not None:
if self._encrypt_correct:
@ -667,8 +664,6 @@ class TCPRelayHandler(object):
self.destroy()
return
if self._encryptor is not None:
self._server.server_transfer_dl += len(data)
self._update_activity(len(data))
if self._is_local:
obfs_decode = self._obfs.client_decode(data)
if obfs_decode[1]:
@ -683,6 +678,8 @@ class TCPRelayHandler(object):
if self._encrypt_correct:
data = self._protocol.server_pre_encrypt(data)
data = self._encryptor.encrypt(data)
self._update_activity(len(data))
self._server.server_transfer_dl += len(data)
else:
return
try:

Loading…
Cancel
Save