diff options
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/flowbasic | 8 | ||||
-rwxr-xr-x | examples/iframe_injector | 4 | ||||
-rwxr-xr-x | examples/proxapp | 4 | ||||
-rwxr-xr-x | examples/stickycookies | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/examples/flowbasic b/examples/flowbasic index b419f9e7..b8184262 100755 --- a/examples/flowbasic +++ b/examples/flowbasic @@ -3,8 +3,8 @@ This example shows how to build a proxy based on mitmproxy's Flow primitives. - Note that request and response messages are not automatically acked, so we - need to implement handlers to do this. + 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 @@ -19,13 +19,13 @@ class MyMaster(flow.FlowMaster): def handle_request(self, r): f = flow.FlowMaster.handle_request(self, r) if f: - r._ack() + r.reply() return f def handle_response(self, r): f = flow.FlowMaster.handle_response(self, r) if f: - r._ack() + r.reply() print f return f diff --git a/examples/iframe_injector b/examples/iframe_injector index 6dd28674..8b1e02f1 100755 --- a/examples/iframe_injector +++ b/examples/iframe_injector @@ -23,14 +23,14 @@ class InjectingMaster(controller.Master): def handle_request(self, msg): if 'Accept-Encoding' in msg.headers: msg.headers["Accept-Encoding"] = 'none' - msg._ack() + msg.reply() def handle_response(self, msg): if msg.content: c = msg.replace('<body>', '<body><iframe src="%s" frameborder="0" height="0" width="0"></iframe>' % self._iframe_url) if c > 0: print 'Iframe injected!' - msg._ack() + msg.reply() def main(argv): diff --git a/examples/proxapp b/examples/proxapp index e8179528..eb5bdbb7 100755 --- a/examples/proxapp +++ b/examples/proxapp @@ -23,13 +23,13 @@ class MyMaster(flow.FlowMaster): def handle_request(self, r): f = flow.FlowMaster.handle_request(self, r) if f: - r._ack() + r.reply() return f def handle_response(self, r): f = flow.FlowMaster.handle_response(self, r) if f: - r._ack() + r.reply() print f return f diff --git a/examples/stickycookies b/examples/stickycookies index 88bf0063..b07820fc 100755 --- a/examples/stickycookies +++ b/examples/stickycookies @@ -25,13 +25,13 @@ class StickyMaster(controller.Master): self.stickyhosts[hid] = msg.headers["cookie"] elif hid in self.stickyhosts: msg.headers["cookie"] = self.stickyhosts[hid] - msg._ack() + msg.reply() def handle_response(self, msg): hid = (msg.request.host, msg.request.port) if msg.headers["set-cookie"]: self.stickyhosts[hid] = msg.headers["set-cookie"] - msg._ack() + msg.reply() config = proxy.ProxyConfig( |