From 8b7db6d9962c05cc46554ae8945661c1216fd491 Mon Sep 17 00:00:00 2001 From: BreakWa11 Date: Tue, 29 Dec 2015 01:31:52 +0800 Subject: [PATCH] fix host name type --- shadowsocks/obfsplugin/http_simple.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shadowsocks/obfsplugin/http_simple.py b/shadowsocks/obfsplugin/http_simple.py index f0d563f..02b8897 100644 --- a/shadowsocks/obfsplugin/http_simple.py +++ b/shadowsocks/obfsplugin/http_simple.py @@ -94,9 +94,9 @@ class http_simple(plain.plain): buf = buf[headlen:] port = b'' if self.server_info.port != 80: - port = b':' + common.to_bytes(str(self.server_info.port)) + port = b':' + to_bytes(str(self.server_info.port)) http_head = b"GET /" + self.encode_head(headdata) + b" HTTP/1.1\r\n" - http_head += b"Host: " + (self.server_info.obfs_param or self.server_info.host) + port + b"\r\n" + http_head += b"Host: " + to_bytes(self.server_info.obfs_param or self.server_info.host) + port + b"\r\n" http_head += b"User-Agent: " + random.choice(self.user_agent) + b"\r\n" http_head += b"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-US,en;q=0.8\r\nAccept-Encoding: gzip, deflate\r\nDNT: 1\r\nConnection: keep-alive\r\n\r\n" self.has_sent_header = True