Proxy Server

class mitmproxy.proxy.ProxyServer(config)[source]
class mitmproxy.proxy.DummyServer(config)[source]
class mitmproxy.proxy.ProxyConfig(host='', port=8080, cadir='~/.mitmproxy', clientcerts=None, no_upstream_cert=False, body_size_limit=None, mode='regular', upstream_server=None, upstream_auth=None, authenticator=None, ignore_hosts=(), tcp_hosts=(), http2=True, rawtcp=False, ciphers_client='ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA', ciphers_server=None, certs=(), ssl_version_client='secure', ssl_version_server='secure', ssl_verify_upstream_cert=False, ssl_verify_upstream_trusted_cadir=None, ssl_verify_upstream_trusted_ca=None, add_upstream_certs_to_client_chain=False)[source]
class mitmproxy.proxy.RootContext(client_conn, config, channel)[source]

The outermost context provided to the root layer. As a consequence, every layer has access to methods and attributes defined here.

client_conn

The client connection.

channel

A Channel to communicate with the FlowMaster. Provides .ask() and .tell() methods.

config

The proxy server's configuration

next_layer(top_layer)[source]

This function determines the next layer in the protocol stack.

Parameters:top_layer – the current innermost layer.
Returns:The next layer
log(msg, level, subs=())[source]

Send a log message to the master.