Support IPv6 address syntax for hosts
This commit is contained in:
parent
e186c7a85d
commit
057af32553
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue