diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-06-19 13:23:07 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-06-19 13:23:07 +1200 |
commit | a700721891e028aacc867001a715a8f7d9cbf223 (patch) | |
tree | 1ed752611078a36f202f2c1defdd96ccf302a335 /libpathod/test.py | |
parent | bd99a13f3965bfdd09a58020424c3b36d97f6877 (diff) | |
download | mitmproxy-a700721891e028aacc867001a715a8f7d9cbf223.tar.gz mitmproxy-a700721891e028aacc867001a715a8f7d9cbf223.tar.bz2 mitmproxy-a700721891e028aacc867001a715a8f7d9cbf223.zip |
Porting to netlib proceeds apace.
Diffstat (limited to 'libpathod/test.py')
-rw-r--r-- | libpathod/test.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libpathod/test.py b/libpathod/test.py index a66124a3..28fcd664 100644 --- a/libpathod/test.py +++ b/libpathod/test.py @@ -7,7 +7,8 @@ IFACE = "127.0.0.1" class Daemon: def __init__(self, staticdir=None, anchors=(), ssl=None): - self.app = pathod.make_app(staticdir=staticdir, anchors=anchors) + #self.app = pathod.make_app(staticdir=staticdir, anchors=anchors) + self.app = None self.q = Queue.Queue() self.thread = PaThread(self.q, self.app, ssl) self.thread.start() @@ -19,7 +20,7 @@ class Daemon: return resp.json def shutdown(self): - requests.post("%s/api/shutdown"%self.urlbase, verify=False) + self.thread.server.shutdown() self.thread.join() @@ -37,6 +38,7 @@ class PaThread(threading.Thread): ) else: ssloptions = self.ssl - self.server, self.port = pathod.make_server(self.app, 0, IFACE, ssloptions) - self.q.put(self.port) - pathod.run(self.server) + self.server = pathod.Pathod((IFACE, 0)) + #self.server, self.port = pathod.make_server(self.app, 0, IFACE, ssloptions) + self.q.put(self.server.port) + self.server.serve_forever() |