diff options
Diffstat (limited to 'libmproxy/proxy.py')
-rw-r--r-- | libmproxy/proxy.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py index 33e50890..c6a68ba3 100644 --- a/libmproxy/proxy.py +++ b/libmproxy/proxy.py @@ -478,6 +478,7 @@ ServerBase.daemon_threads = True # Terminate workers when main thread ter class ProxyServer(ServerBase): request_queue_size = 20 allow_reuse_address = True + bound = True def __init__(self, config, port, address=''): """ Raises ProxyServerError if there's a startup problem. @@ -491,6 +492,10 @@ class ProxyServer(ServerBase): self.certdir = tempfile.mkdtemp(prefix="mitmproxy") config.certdir = self.certdir + def start_slave(self, klass, masterq): + slave = klass(masterq, self) + slave.start() + def set_mqueue(self, q): self.masterq = q @@ -505,6 +510,18 @@ class ProxyServer(ServerBase): pass +class DummyServer: + bound = False + def __init__(self, config): + self.config = config + + def start_slave(self, klass, masterq): + pass + + def shutdown(self): + pass + + # Command-line utils def certificate_option_group(parser): group = optparse.OptionGroup(parser, "SSL") |