aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Freed <dwfreed@mtu.edu>2016-11-12 00:52:14 -0500
committerDoug Freed <dwfreed@mtu.edu>2016-11-14 12:12:48 +0000
commitf89671a33b4ce7e861e16fe2d245f0df5919d6fa (patch)
tree2e1fdd3c7b0d0a2db64bd607c47ee09912528a59
parent078bd532c343d15e534cc0a0769d4354ac7b7279 (diff)
downloadmitmproxy-f89671a33b4ce7e861e16fe2d245f0df5919d6fa.tar.gz
mitmproxy-f89671a33b4ce7e861e16fe2d245f0df5919d6fa.tar.bz2
mitmproxy-f89671a33b4ce7e861e16fe2d245f0df5919d6fa.zip
tools/cmdline: add upstream bind address option
Allow specifying the upstream bind address on the command line.
-rw-r--r--mitmproxy/tools/cmdline.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/mitmproxy/tools/cmdline.py b/mitmproxy/tools/cmdline.py
index 8b579952..4be107a8 100644
--- a/mitmproxy/tools/cmdline.py
+++ b/mitmproxy/tools/cmdline.py
@@ -251,6 +251,7 @@ def get_common_options(args):
ignore_hosts = args.ignore_hosts,
listen_host = args.addr,
listen_port = args.port,
+ upstream_bind_address = args.upstream_bind_address,
mode = mode,
no_upstream_cert = args.no_upstream_cert,
spoof_source_address = args.spoof_source_address,
@@ -486,6 +487,11 @@ def proxy_options(parser):
action="store_true", dest="spoof_source_address",
help="Use the client's IP for server-side connections"
)
+ group.add_argument(
+ "--upstream-bind-address",
+ action="store", type=str, dest="upstream_bind_address", default='',
+ help="Address to bind upstream requests to (defaults to none)"
+ )
def proxy_ssl_options(parser):