From efd45ddfc68c7ad19b35ef4aaf89aa9e7a0515c8 Mon Sep 17 00:00:00 2001 From: clowwindy Date: Fri, 31 Oct 2014 21:59:22 +0800 Subject: [PATCH] fix UDP server --- shadowsocks/common.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shadowsocks/common.py b/shadowsocks/common.py index d585065..fbc977b 100644 --- a/shadowsocks/common.py +++ b/shadowsocks/common.py @@ -105,14 +105,14 @@ def pack_addr(address): try: r = socket.inet_pton(family, address) if family == socket.AF_INET6: - return '\x04' + r + return b'\x04' + r else: - return '\x01' + r + return b'\x01' + r except (TypeError, ValueError, OSError, IOError): pass if len(address) > 255: address = address[:255] # TODO - return '\x03' + chr(len(address)) + address + return b'\x03' + chr(len(address)) + address def parse_header(data):