move web_server for unit tests over to python

This commit is contained in:
Arvid Norberg
2013-11-03 08:15:51 +00:00
parent 5812e8415d
commit b4aad2a481
11 changed files with 204 additions and 614 deletions

View File

@@ -186,7 +186,11 @@ class SocksHandler(StreamRequestHandler):
outbound_sock = socket.socket(socket.AF_INET6)
else:
outbound_sock = socket.socket(socket.AF_INET)
out_address = socket.getaddrinfo(dest_address,dest_port)[0][4]
try:
out_address = socket.getaddrinfo(dest_address,dest_port)[0][4]
except Exception, e:
print e
return
debug("Creating forwarder connection to %r", out_address)
outbound_sock.connect(out_address)