Merge pull request #99 from alonbl/targetconfig

WebSocketProxy: support non path target_cfg
This commit is contained in:
Joel Martin 2013-10-14 11:38:05 -07:00
commit a7fa97f0e1
1 changed files with 4 additions and 3 deletions

View File

@ -83,9 +83,6 @@ Traffic Legend:
"REBIND_OLD_PORT": str(kwargs['listen_port']),
"REBIND_NEW_PORT": str(self.target_port)})
if self.target_cfg:
self.target_cfg = os.path.abspath(self.target_cfg)
websocket.WebSocketServer.__init__(self, *args, **kwargs)
def run_wrap_cmd(self):
@ -388,6 +385,10 @@ def websockify_init():
try: opts.target_port = int(opts.target_port)
except: parser.error("Error parsing target port")
# Transform to absolute path as daemon may chdir
if opts.target_cfg:
opts.target_cfg = os.path.abspath(opts.target_cfg)
# Create and start the WebSockets proxy
server = WebSocketProxy(**opts.__dict__)
server.start_server()