Skip to content

Commit

Permalink
implement all cli interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
triostones committed Mar 28, 2017
1 parent 9e9a92a commit 0313e04
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions browsermobproxy/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,24 @@ def __init__(self, path='browsermob-proxy', options=None):
"in path provided: %s" % path)

self.path = path
self.host = 'localhost'
self.host = options.get('address', '0.0.0.0')
self.port = options.get('port', 8080)
port_range = (self.port + 1, self.port + 501)
proxy_port_range = options.get('proxyPortRange', port_range)
ttl = options.get('ttl', 0)
use_littleproxy = options.get('use-littleproxy', True)
self.process = None

if platform.system() == 'Darwin':
self.command = ['sh']
else:
self.command = []
self.command += [path, '--port=%s' % self.port]
self.command += [path,
'--address=%s' % self.host,
'--port=%s' % self.port,
'--proxyPortRange=%s-%s' % proxy_port_range,
'--ttl=%s' % ttl,
'--use-littleproxy=%s' % use_littleproxy]

def start(self, options=None):
"""
Expand Down

0 comments on commit 0313e04

Please sign in to comment.