diff options
author | Maximilian Hils <git@maximilianhils.com> | 2017-07-17 20:47:44 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2017-07-20 15:27:41 +0200 |
commit | b7bda8f4b216fb278fb688cc656e4e6e5f6423a0 (patch) | |
tree | b9425b1039e74ba47dd285b3ddffbfffda8d577d | |
parent | a81cd18d92be3ec6e326fc039a5282dd927ccc3a (diff) | |
download | mitmproxy-b7bda8f4b216fb278fb688cc656e4e6e5f6423a0.tar.gz mitmproxy-b7bda8f4b216fb278fb688cc656e4e6e5f6423a0.tar.bz2 mitmproxy-b7bda8f4b216fb278fb688cc656e4e6e5f6423a0.zip |
shorten option help
We can have longer versions in the docs, but this makes the
options pages quite hard to parse.
-rw-r--r-- | mitmproxy/eventsequence.py | 11 | ||||
-rw-r--r-- | mitmproxy/options.py | 23 | ||||
-rw-r--r-- | mitmproxy/tools/cmdline.py | 1 |
3 files changed, 17 insertions, 18 deletions
diff --git a/mitmproxy/eventsequence.py b/mitmproxy/eventsequence.py index c2455f24..09322a8f 100644 --- a/mitmproxy/eventsequence.py +++ b/mitmproxy/eventsequence.py @@ -1,7 +1,8 @@ import typing -from mitmproxy import controller, flow +from mitmproxy import controller from mitmproxy import http +from mitmproxy import flow from mitmproxy import tcp from mitmproxy import websocket @@ -10,21 +11,25 @@ Events = frozenset([ "clientdisconnect", "serverconnect", "serverdisconnect", + # TCP "tcp_start", "tcp_message", "tcp_error", "tcp_end", + # HTTP "http_connect", "request", "requestheaders", "response", "responseheaders", "error", + # WebSocket "websocket_handshake", "websocket_start", "websocket_message", "websocket_error", "websocket_end", + # misc "next_layer", "configure", "done", @@ -75,11 +80,11 @@ def _iterate_tcp(f: tcp.TCPFlow): TEventGenerator = typing.Iterator[typing.Tuple[str, typing.Any]] -_iterate_map: typing.Dict[flow.Flow, typing.Callable[[flow.Flow], TEventGenerator]] = { +_iterate_map = { http.HTTPFlow: _iterate_http, websocket.WebSocketFlow: _iterate_websocket, tcp.TCPFlow: _iterate_tcp -} +} # type: typing.Dict[flow.Flow, typing.Callable[[flow.Flow], TEventGenerator]] def iterate(f: flow.Flow) -> TEventGenerator: diff --git a/mitmproxy/options.py b/mitmproxy/options.py index e6c2fed6..954db7e8 100644 --- a/mitmproxy/options.py +++ b/mitmproxy/options.py @@ -209,15 +209,11 @@ class Options(optmanager.OptManager): self.add_option( "proxyauth", Optional[str], None, """ - Require proxy authentication. Value may be "any" to require - authenticaiton but accept any credentials, start with "@" to specify - a path to an Apache htpasswd file, be of the form - "username:password", or be of the form - "ldap[s]:url_server_ldap:dn_auth:password:dn_subtree", - the dn_auth & password is the dn/pass used to authenticate - the dn subtree is the subtree that we will search to find the username - an example would be - "ldap:localhost:cn=default,dc=example,dc=com:password:ou=application,dc=example,dc=com". + Require proxy authentication. Format: + "username:pass", + "any" to accept any user/pass combination, + "@path" to use an Apache htpasswd file, + or "ldap[s]:url_server_ldap:dn_auth:password:dn_subtree" for LDAP authentication. """ ) self.add_option( @@ -288,7 +284,7 @@ class Options(optmanager.OptManager): """ Mode can be "regular", "transparent", "socks5", "reverse:SPEC", or "upstream:SPEC". For reverse and upstream proxy modes, SPEC - is proxy specification in the form of "http[s]://host[:port]". + is host specification in the form of "http[s]://host[:port]". """ ) self.add_option( @@ -311,9 +307,8 @@ class Options(optmanager.OptManager): self.add_option( "http2_priority", bool, False, """ - PRIORITY forwarding for HTTP/2 connections. PRIORITY forwarding is - disabled by default, because some webservers fail to implement the - RFC properly. + PRIORITY forwarding for HTTP/2 connections. Disabled by default to ensure compatibility + with misbehaving servers. """ ) self.add_option( @@ -337,7 +332,7 @@ class Options(optmanager.OptManager): self.add_option( "upstream_auth", Optional[str], None, """ - Add HTTP Basic authentcation to upstream proxy and reverse proxy + Add HTTP Basic authentication to upstream proxy and reverse proxy requests. Format: username:password. """ ) diff --git a/mitmproxy/tools/cmdline.py b/mitmproxy/tools/cmdline.py index cd62aa2c..68ddc2c8 100644 --- a/mitmproxy/tools/cmdline.py +++ b/mitmproxy/tools/cmdline.py @@ -2,7 +2,6 @@ import argparse import os from mitmproxy import options -from mitmproxy import version CONFIG_PATH = os.path.join(options.CA_DIR, "config.yaml") |