diff --git a/untls_proxy.py b/untls_proxy.py index 4f7963b..41e63d6 100755 --- a/untls_proxy.py +++ b/untls_proxy.py @@ -253,6 +253,8 @@ def proxy(sock, host): print('Bad port number', file=sys.stderr) sock.sendall(b'HTTP/1.0 400 Bad Request\r\n\r\nBad port number\n') return + if remote_host[:1] == b'[' and remote_host[-1:] == b']': #IPv6 + remote_host = remote_host[1:-1] try: remote_host = remote_host.decode('ascii') except UnicodeDecodeError: