Skip to content

Commit 84ff31d

Browse files
committed
implement all cli interface.
1 parent 9e9a92a commit 84ff31d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

browsermobproxy/server.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,23 @@ def __init__(self, path='browsermob-proxy', options=None):
8181
"in path provided: %s" % path)
8282

8383
self.path = path
84-
self.host = 'localhost'
84+
self.host = options.get('address', '0.0.0.0')
8585
self.port = options.get('port', 8080)
86+
proxy_port_range = options.get('proxyPortRange', (8081, 8581))
87+
ttl = options.get('ttl', 0)
88+
use_littleproxy = options.get('use-littleproxy', True)
8689
self.process = None
8790

8891
if platform.system() == 'Darwin':
8992
self.command = ['sh']
9093
else:
9194
self.command = []
92-
self.command += [path, '--port=%s' % self.port]
95+
self.command += [path,
96+
'--address=%s' % self.host,
97+
'--port=%s' % self.port,
98+
'--proxyPortRange=%s-%s' % proxy_port_range,
99+
'--ttl=%s' % ttl,
100+
'--use-littleproxy=%s' % use_littleproxy]
93101

94102
def start(self, options=None):
95103
"""

0 commit comments

Comments
 (0)