From f3f36cf8bfc19b46c6159bf0f71cf7427db74e36 Mon Sep 17 00:00:00 2001 From: Joshua Bronson Date: Sat, 29 Oct 2022 13:38:00 -0400 Subject: [PATCH] Don't restrict destination port to (8)443. Fixes #1. --- trio_http_proxy.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/trio_http_proxy.py b/trio_http_proxy.py index 6f69889..e7c9958 100755 --- a/trio_http_proxy.py +++ b/trio_http_proxy.py @@ -20,7 +20,6 @@ import trio DEFAULT_PORT = 8080 PORT = int(getenv('PORT', DEFAULT_PORT)) -OK_CONNECT_PORTS = {443, 8443} prn = partial(print, end='') indented = partial(indent, prefix=' ') @@ -88,7 +87,6 @@ async def process_as_connect_request(stream, bufmaxsz=DEFAULT_BUFFER_SIZE, maxre assert h11_nextevt.method == b'CONNECT', f'{h11_nextevt.method=} != CONNECT' desthost, _, destport = h11_nextevt.target.partition(b':') destport = int(destport.decode()) - assert destport in OK_CONNECT_PORTS, f'{destport=} not in {OK_CONNECT_PORTS}' return desthost.decode(), destport