From a66913d4a30b2ce2dedc58afcf79ad77faead278 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Fri, 14 Mar 2014 00:02:00 +0100 Subject: [PATCH] forward proxy -> upstream proxy --- doc-src/_nav.html | 2 +- doc-src/features/index.py | 2 +- doc-src/features/reverseproxy.html | 6 +++--- .../{forwardproxy.html => upstreamproxy.html} | 6 +++--- libmproxy/cmdline.py | 12 ++++++------ libmproxy/proxy/config.py | 10 +++++----- libmproxy/proxy/primitives.py | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) rename doc-src/features/{forwardproxy.html => upstreamproxy.html} (64%) diff --git a/doc-src/_nav.html b/doc-src/_nav.html index 5460601ff..ddc27dca8 100644 --- a/doc-src/_nav.html +++ b/doc-src/_nav.html @@ -11,7 +11,7 @@ $!nav("anticache.html", this, state)!$ $!nav("clientreplay.html", this, state)!$ $!nav("filters.html", this, state)!$ - $!nav("forwardproxy.html", this, state)!$ + $!nav("upstreamproxy.html", this, state)!$ $!nav("proxyauth.html", this, state)!$ $!nav("replacements.html", this, state)!$ $!nav("serverreplay.html", this, state)!$ diff --git a/doc-src/features/index.py b/doc-src/features/index.py index e15f3311c..0618681f8 100644 --- a/doc-src/features/index.py +++ b/doc-src/features/index.py @@ -4,7 +4,7 @@ pages = [ Page("anticache.html", "Anticache"), Page("clientreplay.html", "Client-side replay"), Page("filters.html", "Filter expressions"), - Page("forwardproxy.html", "Forward proxy mode"), + Page("upstreamproxy.html", "Upstream proxy mode"), Page("setheaders.html", "Set Headers"), Page("serverreplay.html", "Server-side replay"), Page("sticky.html", "Sticky cookies and auth"), diff --git a/doc-src/features/reverseproxy.html b/doc-src/features/reverseproxy.html index 7be02b876..7ad1c26c9 100644 --- a/doc-src/features/reverseproxy.html +++ b/doc-src/features/reverseproxy.html @@ -1,8 +1,8 @@ In reverse proxy mode, mitmproxy accepts standard HTTP requests and forwards -them to the specified upstream server. This is in contrast to forward proxy mode, in which -mitmproxy forwards HTTP proxy requests to an upstream server. +them to the specified upstream server. This is in contrast to +upstream proxy mode, in which +mitmproxy forwards HTTP proxy requests to an upstream proxy server. Note that the displayed URL for flows in this mode will use the value of the __Host__ header field from the request, not the reverse proxy server. diff --git a/doc-src/features/forwardproxy.html b/doc-src/features/upstreamproxy.html similarity index 64% rename from doc-src/features/forwardproxy.html rename to doc-src/features/upstreamproxy.html index 203520d51..5b9c22892 100644 --- a/doc-src/features/forwardproxy.html +++ b/doc-src/features/upstreamproxy.html @@ -1,16 +1,16 @@ In this mode, mitmproxy accepts proxy requests and unconditionally forwards all -requests to a specified upstream server. This is in contrast to reverse proxy mode, in which mitmproxy forwards ordinary HTTP requests to an upstream server. - + - +
command-line -F http[s]://hostname[:port]command-line -U http[s]://hostname[:port]
mitmproxy shortcut Fmitmproxy shortcut U
diff --git a/libmproxy/cmdline.py b/libmproxy/cmdline.py index ed3a8f6b7..22db25fba 100644 --- a/libmproxy/cmdline.py +++ b/libmproxy/cmdline.py @@ -255,9 +255,9 @@ def common_options(parser): help = "Address to bind proxy to (defaults to all interfaces)" ) group.add_argument( - "-F", - action="store", type=parse_server_spec, dest="forward_proxy", default=None, - help="Proxy to unconditionally forward to: http[s]://host[:port]" + "-U", + action="store", type=parse_server_spec, dest="upstream_proxy", default=None, + help="Forward all requests to upstream proxy server: http[s]://host[:port]" ) group.add_argument( "-n", @@ -272,7 +272,7 @@ def common_options(parser): group.add_argument( "-R", action="store", type=parse_server_spec, dest="reverse_proxy", default=None, - help="Reverse proxy to upstream server: http[s]://host[:port]" + help="Forward all requests to upstream HTTP server: http[s][2http[s]]://host[:port]" ) group.add_argument( "-T", @@ -299,9 +299,9 @@ def common_options(parser): help="Override the HTTP request form sent upstream by the proxy" ) group.add_argument( - "--upstream-server", dest="manual_upstream_server", default=None, + "--destination-server", dest="manual_destination_server", default=None, action="store", type=parse_server_spec, - help="Override the destination server all requests are sent to." + help="Override the destination server all requests are sent to: http[s][2http[s]]://host[:port]" ) diff --git a/libmproxy/proxy/config.py b/libmproxy/proxy/config.py index d3f55f60a..067c361d9 100644 --- a/libmproxy/proxy/config.py +++ b/libmproxy/proxy/config.py @@ -44,15 +44,15 @@ def process_proxy_options(parser, options): c += 1 get_upstream_server = ConstUpstreamServerResolver(options.reverse_proxy) http_form_in, http_form_out = "relative", "relative" - if options.forward_proxy: + if options.upstream_proxy: c += 1 - get_upstream_server = ConstUpstreamServerResolver(options.forward_proxy) + get_upstream_server = ConstUpstreamServerResolver(options.upstream_proxy) http_form_in, http_form_out = "absolute", "absolute" - if options.manual_upstream_server: + if options.manual_destination_server: c += 1 - get_upstream_server = ConstUpstreamServerResolver(options.manual_upstream_server) + get_upstream_server = ConstUpstreamServerResolver(options.manual_destination_server) if c > 1: - return parser.error("Transparent mode, reverse mode, forward mode and " + return parser.error("Transparent mode, reverse mode, upstream proxy mode and " "specification of an upstream server are mutually exclusive.") if options.http_form_in: http_form_in = options.http_form_in diff --git a/libmproxy/proxy/primitives.py b/libmproxy/proxy/primitives.py index 0fa5273b9..691db9222 100644 --- a/libmproxy/proxy/primitives.py +++ b/libmproxy/proxy/primitives.py @@ -61,7 +61,7 @@ class AddressPriority(object): MANUALLY_CHANGED = 3 """user changed the target address in the ui""" FROM_SETTINGS = 2 - """upstream server from arguments (reverse proxy, forward proxy or from transparent resolver)""" + """upstream server from arguments (reverse proxy, upstream proxy or from transparent resolver)""" FROM_PROTOCOL = 1 """derived from protocol (e.g. absolute-form http requests)"""