aboutsummaryrefslogtreecommitdiffstats
path: root/examples/flowbasic
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@corte.si>2014-09-07 12:59:35 +1200
committerAldo Cortesi <aldo@corte.si>2014-09-07 12:59:35 +1200
commit3d62e90dbf7ea05283e16752531a261e53a4bb47 (patch)
treec3f5aed62bcf13378522968a1c77375dc8102b53 /examples/flowbasic
parent0e0cff638c1e055275e77e2af0ae540542f77197 (diff)
parentfdd7b2f108717900e39e3d0ab220ee65b79304ef (diff)
downloadmitmproxy-3d62e90dbf7ea05283e16752531a261e53a4bb47.tar.gz
mitmproxy-3d62e90dbf7ea05283e16752531a261e53a4bb47.tar.bz2
mitmproxy-3d62e90dbf7ea05283e16752531a261e53a4bb47.zip
Merge pull request #342 from mitmproxy/server_change_api
Server change api
Diffstat (limited to 'examples/flowbasic')
-rwxr-xr-xexamples/flowbasic9
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/flowbasic b/examples/flowbasic
index 8dbe2f28..2b44be3f 100755
--- a/examples/flowbasic
+++ b/examples/flowbasic
@@ -3,11 +3,14 @@
This example shows how to build a proxy based on mitmproxy's Flow
primitives.
+ Heads Up: In the majority of cases, you want to use inline scripts.
+
Note that request and response messages are not automatically replied to,
so we need to implement handlers to do this.
"""
import os
-from libmproxy import proxy, flow
+from libmproxy import flow, proxy
+from libmproxy.proxy.server import ProxyServer
class MyMaster(flow.FlowMaster):
def run(self):
@@ -31,9 +34,9 @@ class MyMaster(flow.FlowMaster):
config = proxy.ProxyConfig(
- cacert = os.path.expanduser("~/.mitmproxy/mitmproxy-ca.pem")
+ ca_file = os.path.expanduser("~/.mitmproxy/mitmproxy-ca.pem")
)
state = flow.State()
-server = proxy.ProxyServer(config, 8080)
+server = ProxyServer(config, 8080)
m = MyMaster(server, state)
m.run()