Add option to tell mitmproxy which interfaces to bind to.

This commit is contained in:
Aldo Cortesi
2011-02-06 10:52:54 +13:00
parent d0c2d9480c
commit 44dc3a052e
3 changed files with 19 additions and 6 deletions

View File

@@ -632,7 +632,14 @@ class StatusBar(WWrap):
if self.expire and time.time() > self.expire:
self.message("")
status = urwid.Columns([
urwid.Text([('title', "mproxy:%s"%self.master.server.port)]),
urwid.Text(
[
(
'title',
"mitmproxy %s:%s"%(self.master.server.address, self.master.server.port)
)
]
),
urwid.Text(
[
self.text,

View File

@@ -471,9 +471,9 @@ ServerBase = SocketServer.ThreadingTCPServer
class ProxyServer(ServerBase):
request_queue_size = 20
allow_reuse_address = True
def __init__(self, port):
self.port = port
ServerBase.__init__(self, ('', port), ProxyHandler)
def __init__(self, port, address=''):
self.port, self.address = port, address
ServerBase.__init__(self, (address, port), ProxyHandler)
self.masterq = None
def set_mqueue(self, q):