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 Feb 27, 2017
1 parent 9e9a92a commit ce5fd8b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions browsermobproxy/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,21 @@ 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)
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,
'--ttl=%s' % ttl,
'--use-littleproxy=%s' % use_littleproxy]

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

0 comments on commit ce5fd8b

Please sign in to comment.