mirror of
https://github.com/vee1e/mitmproxy.git
synced 2026-09-02 10:47:14 +00:00
Merge branch 'master' into tcp_proxy
This commit is contained in:
commit
9a55cd7332
2 changed files with 18 additions and 2 deletions
17
examples/read_dumpfile.py
Normal file
17
examples/read_dumpfile.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# Simple script showing how to read a mitmproxy dump file
|
||||
#
|
||||
|
||||
from libmproxy import flow
|
||||
import json, sys
|
||||
|
||||
with open("logfile", "rb") as f:
|
||||
freader = flow.FlowReader(f)
|
||||
try:
|
||||
for i in freader.stream():
|
||||
print i.request.host
|
||||
json.dump(i._get_state(), sys.stdout, indent=4)
|
||||
print ""
|
||||
except flow.FlowReadError, v:
|
||||
print "Flow file corrupted. Stopped loading."
|
||||
|
|
@ -223,8 +223,7 @@ class DumpMaster(flow.FlowMaster):
|
|||
|
||||
def run(self): # pragma: no cover
|
||||
if self.o.rfile and not self.o.keepserving:
|
||||
for script in self.scripts:
|
||||
self.unload_script(script)
|
||||
self.shutdown()
|
||||
return
|
||||
try:
|
||||
return flow.FlowMaster.run(self)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue