mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 18:18:25 +00:00
Py3: pathoc should send bytes over wire
This commit is contained in:
parent
500bf18023
commit
cd5ef042bb
@ -241,8 +241,8 @@ class Pathoc(tcp.TCPClient):
|
|||||||
|
|
||||||
def http_connect(self, connect_to):
|
def http_connect(self, connect_to):
|
||||||
self.wfile.write(
|
self.wfile.write(
|
||||||
'CONNECT %s:%s HTTP/1.1\r\n' % tuple(connect_to) +
|
b'CONNECT %s:%d HTTP/1.1\r\n' % (connect_to[0].encode(), connect_to[1]) +
|
||||||
'\r\n'
|
b'\r\n'
|
||||||
)
|
)
|
||||||
self.wfile.flush()
|
self.wfile.flush()
|
||||||
try:
|
try:
|
||||||
|
@ -17,9 +17,9 @@ class HTTPProtocol(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
self.pathod_handler.wfile.write(
|
self.pathod_handler.wfile.write(
|
||||||
'HTTP/1.1 200 Connection established\r\n' +
|
b'HTTP/1.1 200 Connection established\r\n' +
|
||||||
('Proxy-agent: %s\r\n' % version.PATHOD) +
|
(b'Proxy-agent: %s\r\n' % version.PATHOD.encode()) +
|
||||||
'\r\n'
|
b'\r\n'
|
||||||
)
|
)
|
||||||
self.pathod_handler.wfile.flush()
|
self.pathod_handler.wfile.flush()
|
||||||
if not self.pathod_handler.server.ssloptions.not_after_connect:
|
if not self.pathod_handler.server.ssloptions.not_after_connect:
|
||||||
|
Loading…
Reference in New Issue
Block a user