aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@corte.si>2018-05-06 11:27:14 +1200
committerGitHub <noreply@github.com>2018-05-06 11:27:14 +1200
commitc53bc39c9547685d4227d9b4ad48a22d6d11dbff (patch)
tree8426096ff1876e3ebcab3f4165d8fffe4391c0e4 /mitmproxy
parentb4f618e801ba0dcf5c59b5c3781eb5b2724133e0 (diff)
parent54e2daa21e2c56c7c1469ce4239f9a4ff7815bc4 (diff)
downloadmitmproxy-c53bc39c9547685d4227d9b4ad48a22d6d11dbff.tar.gz
mitmproxy-c53bc39c9547685d4227d9b4ad48a22d6d11dbff.tar.bz2
mitmproxy-c53bc39c9547685d4227d9b4ad48a22d6d11dbff.zip
Merge pull request #3099 from Kriechi/fix-3024
fix #3024
Diffstat (limited to 'mitmproxy')
-rw-r--r--mitmproxy/addons/allowremote.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mitmproxy/addons/allowremote.py b/mitmproxy/addons/allowremote.py
index f1d3d8fb..ad4c4940 100644
--- a/mitmproxy/addons/allowremote.py
+++ b/mitmproxy/addons/allowremote.py
@@ -14,11 +14,13 @@ class AllowRemote:
)
def clientconnect(self, layer):
- address = layer.client_conn.address
+ address = ipaddress.ip_address(layer.client_conn.address[0])
+ if isinstance(address, ipaddress.IPv6Address):
+ address = address.ipv4_mapped or address
accept_connection = (
ctx.options.allow_remote or
- ipaddress.ip_address(address[0]).is_private or
+ ipaddress.ip_address(address).is_private or
ctx.options.proxyauth is not None
)