Show More
@@ -26,6 +26,11 b' httpserver = util.httpserver' | |||
|
26 | 26 | urlparse = util.urlparse |
|
27 | 27 | socketserver = util.socketserver |
|
28 | 28 | |
|
29 | if os.environ.get('HGIPV6', '0') == '1': | |
|
30 | family = socket.AF_INET6 | |
|
31 | else: | |
|
32 | family = socket.AF_INET | |
|
33 | ||
|
29 | 34 | class ProxyHandler (httpserver.basehttprequesthandler): |
|
30 | 35 | __base = httpserver.basehttprequesthandler |
|
31 | 36 | __base_handle = __base.handle |
@@ -65,7 +70,7 b' class ProxyHandler (httpserver.basehttpr' | |||
|
65 | 70 | return 1 |
|
66 | 71 | |
|
67 | 72 | def do_CONNECT(self): |
|
68 |
soc = socket.socket( |
|
|
73 | soc = socket.socket(family, socket.SOCK_STREAM) | |
|
69 | 74 | try: |
|
70 | 75 | if self._connect_to(self.path, soc): |
|
71 | 76 | self.log_request(200) |
@@ -85,7 +90,7 b' class ProxyHandler (httpserver.basehttpr' | |||
|
85 | 90 | if scm != 'http' or fragment or not netloc: |
|
86 | 91 | self.send_error(400, "bad url %s" % self.path) |
|
87 | 92 | return |
|
88 |
soc = socket.socket( |
|
|
93 | soc = socket.socket(family, socket.SOCK_STREAM) | |
|
89 | 94 | try: |
|
90 | 95 | if self._connect_to(netloc, soc): |
|
91 | 96 | self.log_request() |
General Comments 0
You need to be logged in to leave comments.
Login now