From 1ed149a46a29cebe4320a6745f6185e39fed75e8 Mon Sep 17 00:00:00 2001 From: clowwindy Date: Wed, 23 Apr 2014 22:44:10 +0800 Subject: [PATCH] udp server works --- shadowsocks/udprelay.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shadowsocks/udprelay.py b/shadowsocks/udprelay.py index 20b9ad0..711da06 100644 --- a/shadowsocks/udprelay.py +++ b/shadowsocks/udprelay.py @@ -174,7 +174,11 @@ class UDPRelay(object): else: # drop return - self._eventloop.add(client, eventloop.MODE_IN) + self._eventloop.add(client, eventloop.MODE_IN) + + data = data[header_length:] + if not data: + return if self._is_local: data = encrypt.encrypt_all(self._password, self._method, 1, data) if not data: