aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/flowbasic5
-rw-r--r--examples/flowwriter.py5
-rw-r--r--examples/read_dumpfile2
3 files changed, 5 insertions, 7 deletions
diff --git a/examples/flowbasic b/examples/flowbasic
index bac98916..cb1e4ea4 100755
--- a/examples/flowbasic
+++ b/examples/flowbasic
@@ -8,7 +8,7 @@
Note that request and response messages are not automatically replied to,
so we need to implement handlers to do this.
"""
-from mitmproxy import flow, controller, options
+from mitmproxy import controller, options, master
from mitmproxy.proxy import ProxyServer, ProxyConfig
@@ -37,7 +37,6 @@ class MyMaster(master.Master):
opts = options.Options(cadir="~/.mitmproxy/")
config = ProxyConfig(opts)
-state = state.State()
server = ProxyServer(config)
-m = MyMaster(opts, server, state)
+m = MyMaster(opts, server)
m.run()
diff --git a/examples/flowwriter.py b/examples/flowwriter.py
index df2e5a40..afce85aa 100644
--- a/examples/flowwriter.py
+++ b/examples/flowwriter.py
@@ -1,7 +1,6 @@
import random
import sys
-
-from mitmproxy.flow import FlowWriter
+from mimtproxy import io
class Writer:
@@ -10,7 +9,7 @@ class Writer:
f = sys.stdout
else:
f = open(path, "wb")
- self.w = FlowWriter(f)
+ self.w = io.FlowWriter(f)
def response(self, flow):
if random.choice([True, False]):
diff --git a/examples/read_dumpfile b/examples/read_dumpfile
index b1001c3d..e0e9064a 100644
--- a/examples/read_dumpfile
+++ b/examples/read_dumpfile
@@ -9,7 +9,7 @@ import pprint
import sys
with open(sys.argv[1], "rb") as logfile:
- freader = flow.FlowReader(logfile)
+ freader = io.FlowReader(logfile)
pp = pprint.PrettyPrinter(indent=4)
try:
for f in freader.stream():