Browse Source

move connect to a proper place

1.4
clowwindy 11 years ago
parent
commit
9ffb0320bb
  1. 6
      shadowsocks/udprelay.py

6
shadowsocks/udprelay.py

@ -176,6 +176,10 @@ class UDPRelay(object):
return
self._eventloop.add(client, eventloop.MODE_IN)
# prevent from recv other sources
if self._is_local:
client.connect((server_addr, server_port))
data = data[header_length:]
if not data:
return
@ -183,8 +187,6 @@ class UDPRelay(object):
data = encrypt.encrypt_all(self._password, self._method, 1, data)
if not data:
return
# prevent from recv other sources
client.connect((server_addr, server_port))
client.sendto(data, (server_addr, server_port))
def _handle_client(self, sock):

Loading…
Cancel
Save