From 7b62f9f5302271bf5f030c7aed1d0df3813c7cc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=B4=E5=A8=83=E9=85=B1?= Date: Fri, 16 Jun 2017 21:45:56 +0800 Subject: [PATCH] fix http_post under py3 --- shadowsocks/obfsplugin/http_simple.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shadowsocks/obfsplugin/http_simple.py b/shadowsocks/obfsplugin/http_simple.py index 67f97b6..30d7ca9 100644 --- a/shadowsocks/obfsplugin/http_simple.py +++ b/shadowsocks/obfsplugin/http_simple.py @@ -219,7 +219,7 @@ class http_post(http_simple): super(http_post, self).__init__(method) def boundary(self): - return b''.join([chr(random.choice(b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")) for i in range(32)]) + return to_bytes(''.join([random.choice("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") for i in range(32)])) def client_encode(self, buf): if self.has_sent_header: