mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
fix --playback-port option (https://github.com/internetarchive/warcprox/issues/29)
This commit is contained in:
parent
13ee68ce4a
commit
7e55568851
2
setup.py
2
setup.py
@ -50,7 +50,7 @@ except:
|
||||
|
||||
setuptools.setup(
|
||||
name='warcprox',
|
||||
version='2.1b1.dev94',
|
||||
version='2.1b1.dev95',
|
||||
description='WARC writing MITM HTTP/S proxy',
|
||||
url='https://github.com/internetarchive/warcprox',
|
||||
author='Noah Levitt',
|
||||
|
@ -212,11 +212,10 @@ def init_controller(args):
|
||||
stats_db=stats_db, options=options)
|
||||
|
||||
if args.playback_port is not None:
|
||||
playback_index_db = warcprox.playback.PlaybackIndexDb(args.playback_index_db_file, options=options)
|
||||
playback_index_db = warcprox.playback.PlaybackIndexDb(
|
||||
args.playback_index_db_file, options=options)
|
||||
playback_proxy = warcprox.playback.PlaybackProxy(
|
||||
server_address=(args.address, args.playback_port), ca=ca,
|
||||
playback_index_db=playback_index_db, warcs_dir=args.directory,
|
||||
options=options)
|
||||
ca=ca, playback_index_db=playback_index_db, options=options)
|
||||
listeners.append(playback_index_db)
|
||||
else:
|
||||
playback_index_db = None
|
||||
|
@ -210,7 +210,6 @@ class PlaybackProxyHandler(MitmProxyHandler):
|
||||
class PlaybackProxy(socketserver.ThreadingMixIn, http_server.HTTPServer):
|
||||
logger = logging.getLogger("warcprox.playback.PlaybackProxy")
|
||||
|
||||
|
||||
def __init__(self, ca=None, playback_index_db=None, options=warcprox.Options()):
|
||||
server_address = (options.address or 'localhost', options.playback_port if options.playback_port is not None else 8001)
|
||||
http_server.HTTPServer.__init__(self, server_address, PlaybackProxyHandler, bind_and_activate=True)
|
||||
@ -231,7 +230,7 @@ class PlaybackProxy(socketserver.ThreadingMixIn, http_server.HTTPServer):
|
||||
class PlaybackIndexDb(object):
|
||||
logger = logging.getLogger("warcprox.playback.PlaybackIndexDb")
|
||||
|
||||
def __init__(self, file='./warcprox.sqlite'):
|
||||
def __init__(self, file='./warcprox.sqlite', options=warcprox.Options()):
|
||||
self.file = file
|
||||
self._lock = threading.RLock()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user