diff options
author | Maximilian Hils <git@maximilianhils.com> | 2017-08-13 23:14:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-13 23:14:20 +0200 |
commit | 96c8c75ce6b8c656e5f03312479c32082d5a89b7 (patch) | |
tree | f4d8e01492d424c07ed5799bf7d3e512b6f231f2 | |
parent | b7c02b9eb53c2df0851c119a3be61ee137cbba4e (diff) | |
parent | 38fe2f244ae277ffe5b9618bca669da0bf659ad7 (diff) | |
download | mitmproxy-96c8c75ce6b8c656e5f03312479c32082d5a89b7.tar.gz mitmproxy-96c8c75ce6b8c656e5f03312479c32082d5a89b7.tar.bz2 mitmproxy-96c8c75ce6b8c656e5f03312479c32082d5a89b7.zip |
Merge pull request #2519 from titeuf87/no_ipv6_fallback_fix
Fallback correctly to ipv4 when ipv6 is not supported
-rw-r--r-- | mitmproxy/net/tcp.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mitmproxy/net/tcp.py b/mitmproxy/net/tcp.py index 0c2f0e28..e109236e 100644 --- a/mitmproxy/net/tcp.py +++ b/mitmproxy/net/tcp.py @@ -855,6 +855,8 @@ class TCPServer: if self.address[0] == 'localhost': raise socket.error("Binding to 'localhost' is prohibited. Please use '::1' or '127.0.0.1' directly.") + self.socket = None + try: # First try to bind an IPv6 socket, with possible IPv4 if the OS supports it. # This allows us to accept connections for ::1 and 127.0.0.1 on the same socket. |