From f89671a33b4ce7e861e16fe2d245f0df5919d6fa Mon Sep 17 00:00:00 2001 From: Doug Freed Date: Sat, 12 Nov 2016 00:52:14 -0500 Subject: [PATCH] tools/cmdline: add upstream bind address option Allow specifying the upstream bind address on the command line. --- mitmproxy/tools/cmdline.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mitmproxy/tools/cmdline.py b/mitmproxy/tools/cmdline.py index 8b5799524..4be107a8e 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):