Skip to content

Commit dcca21a

Browse files
committed
feat(proto.httponly): fall back to CONNECT for port 443
1 parent 7c96730 commit dcca21a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pproxy/proto.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@ async def http_channel(self, reader, writer, stat_bytes, stat_conn):
359359

360360
class HTTPOnly(HTTP):
361361
async def connect(self, reader_remote, writer_remote, rauth, host_name, port, myhost, **kw):
362+
if port == 443: # TODO: Is there a better way to detect HTTPS protocol?
363+
return await super().connect(reader_remote, writer_remote, rauth, host_name, port, myhost, **kw)
362364
buffer = bytearray()
363365
HOST_NAME = re.compile('\r\nHost: ([^\r\n]+)\r\n', re.I)
364366
def write(data, o=writer_remote.write):

0 commit comments

Comments
 (0)