Skip to content

Commit

Permalink
Merge pull request #151 from Mervent/master
Browse files Browse the repository at this point in the history
Obey RFC2616 in CONNECT request
  • Loading branch information
qwj authored Jan 13, 2024
2 parents 7c96730 + fe495ce commit 4863477
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pproxy/proto.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ async def connected(writer):
writer.write(f'{method} {newpath} {ver}\r\n{lines}\r\n\r\n'.encode())
return True
return user, host_name, port, connected
async def connect(self, reader_remote, writer_remote, rauth, host_name, port, myhost, **kw):
writer_remote.write(f'CONNECT {host_name}:{port} HTTP/1.1\r\nHost: {myhost}'.encode() + (b'\r\nProxy-Authorization: Basic '+base64.b64encode(rauth) if rauth else b'') + b'\r\n\r\n')
async def connect(self, reader_remote, writer_remote, rauth, host_name, port, **kw):
writer_remote.write(f'CONNECT {host_name}:{port} HTTP/1.1\r\nHost: {host_name}:{port}'.encode() + (b'\r\nProxy-Authorization: Basic '+base64.b64encode(rauth) if rauth else b'') + b'\r\n\r\n')
await reader_remote.read_until(b'\r\n\r\n')
async def http_channel(self, reader, writer, stat_bytes, stat_conn):
try:
Expand Down

0 comments on commit 4863477

Please sign in to comment.