diff --git a/pathod/pathoc.py b/pathod/pathoc.py index 478ce2a2b..b539fec49 100644 --- a/pathod/pathoc.py +++ b/pathod/pathoc.py @@ -241,8 +241,8 @@ class Pathoc(tcp.TCPClient): def http_connect(self, connect_to): self.wfile.write( - 'CONNECT %s:%s HTTP/1.1\r\n' % tuple(connect_to) + - '\r\n' + b'CONNECT %s:%d HTTP/1.1\r\n' % (connect_to[0].encode(), connect_to[1]) + + b'\r\n' ) self.wfile.flush() try: diff --git a/pathod/protocols/http.py b/pathod/protocols/http.py index 7736df4b5..9756c2668 100644 --- a/pathod/protocols/http.py +++ b/pathod/protocols/http.py @@ -17,9 +17,9 @@ class HTTPProtocol(object): """ self.pathod_handler.wfile.write( - 'HTTP/1.1 200 Connection established\r\n' + - ('Proxy-agent: %s\r\n' % version.PATHOD) + - '\r\n' + b'HTTP/1.1 200 Connection established\r\n' + + (b'Proxy-agent: %s\r\n' % version.PATHOD.encode()) + + b'\r\n' ) self.pathod_handler.wfile.flush() if not self.pathod_handler.server.ssloptions.not_after_connect: