Don't restrict destination port to (8)443.

Fixes #1.
This commit is contained in:
Joshua Bronson 2022-10-29 13:38:00 -04:00
parent d0e7bcf55c
commit f3f36cf8bf

View File

@ -20,7 +20,6 @@ import trio
DEFAULT_PORT = 8080 DEFAULT_PORT = 8080
PORT = int(getenv('PORT', DEFAULT_PORT)) PORT = int(getenv('PORT', DEFAULT_PORT))
OK_CONNECT_PORTS = {443, 8443}
prn = partial(print, end='') prn = partial(print, end='')
indented = partial(indent, prefix=' ') 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' assert h11_nextevt.method == b'CONNECT', f'{h11_nextevt.method=} != CONNECT'
desthost, _, destport = h11_nextevt.target.partition(b':') desthost, _, destport = h11_nextevt.target.partition(b':')
destport = int(destport.decode()) destport = int(destport.decode())
assert destport in OK_CONNECT_PORTS, f'{destport=} not in {OK_CONNECT_PORTS}'
return desthost.decode(), destport return desthost.decode(), destport