parent
b9194bf175
commit
992a2d1793
|
|
@ -367,7 +367,7 @@ class WebSocketProxy(websockifyserver.WebSockifyServer):
|
||||||
else:
|
else:
|
||||||
dst_string = "%s:%s" % (self.target_host, self.target_port)
|
dst_string = "%s:%s" % (self.target_host, self.target_port)
|
||||||
|
|
||||||
if self.listen_fd != None:
|
if self.listen_fd is not None:
|
||||||
src_string = "inetd"
|
src_string = "inetd"
|
||||||
else:
|
else:
|
||||||
src_string = "%s:%s" % (self.listen_host, self.listen_port)
|
src_string = "%s:%s" % (self.listen_host, self.listen_port)
|
||||||
|
|
@ -392,11 +392,11 @@ class WebSocketProxy(websockifyserver.WebSockifyServer):
|
||||||
|
|
||||||
if self.wrap_cmd and self.cmd:
|
if self.wrap_cmd and self.cmd:
|
||||||
ret = self.cmd.poll()
|
ret = self.cmd.poll()
|
||||||
if ret != None:
|
if ret is not None:
|
||||||
self.vmsg("Wrapped command exited (or daemon). Returned %s" % ret)
|
self.vmsg("Wrapped command exited (or daemon). Returned %s" % ret)
|
||||||
self.cmd = None
|
self.cmd = None
|
||||||
|
|
||||||
if self.wrap_cmd and self.cmd == None:
|
if self.wrap_cmd and self.cmd is None:
|
||||||
# Response to wrapped command being gone
|
# Response to wrapped command being gone
|
||||||
if self.wrap_mode == "ignore":
|
if self.wrap_mode == "ignore":
|
||||||
pass
|
pass
|
||||||
|
|
@ -708,7 +708,7 @@ def websockify_init():
|
||||||
except ValueError:
|
except ValueError:
|
||||||
parser.error("Error parsing target port")
|
parser.error("Error parsing target port")
|
||||||
|
|
||||||
if len(args) > 0 and opts.wrap_cmd == None:
|
if len(args) > 0 and opts.wrap_cmd is None:
|
||||||
parser.error("Too many arguments")
|
parser.error("Too many arguments")
|
||||||
|
|
||||||
if opts.token_plugin is not None:
|
if opts.token_plugin is not None:
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ for mod, msg in [('ssl', 'TLS/SSL/wss is disabled'),
|
||||||
try:
|
try:
|
||||||
globals()[mod] = __import__(mod)
|
globals()[mod] = __import__(mod)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
globals()[mod] = None
|
globals()[mod] is None
|
||||||
print("WARNING: no '%s' module, %s" % (mod, msg))
|
print("WARNING: no '%s' module, %s" % (mod, msg))
|
||||||
|
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
|
|
@ -405,9 +405,9 @@ class WebSockifyServer():
|
||||||
|
|
||||||
# Show configuration
|
# Show configuration
|
||||||
self.msg("WebSocket server settings:")
|
self.msg("WebSocket server settings:")
|
||||||
if self.listen_fd != None:
|
if self.listen_fd is not None:
|
||||||
self.msg(" - Listen for inetd connections")
|
self.msg(" - Listen for inetd connections")
|
||||||
elif self.unix_listen != None:
|
elif self.unix_listen is not None:
|
||||||
self.msg(" - Listen on unix socket %s", self.unix_listen)
|
self.msg(" - Listen on unix socket %s", self.unix_listen)
|
||||||
else:
|
else:
|
||||||
self.msg(" - Listen on %s:%s",
|
self.msg(" - Listen on %s:%s",
|
||||||
|
|
@ -741,9 +741,9 @@ class WebSockifyServer():
|
||||||
"""
|
"""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if self.listen_fd != None:
|
if self.listen_fd is not None:
|
||||||
lsock = socket.fromfd(self.listen_fd, socket.AF_INET, socket.SOCK_STREAM)
|
lsock = socket.fromfd(self.listen_fd, socket.AF_INET, socket.SOCK_STREAM)
|
||||||
elif self.unix_listen != None:
|
elif self.unix_listen is not None:
|
||||||
lsock = self.socket(host=None,
|
lsock = self.socket(host=None,
|
||||||
unix_socket=self.unix_listen,
|
unix_socket=self.unix_listen,
|
||||||
unix_socket_mode=self.unix_listen_mode,
|
unix_socket_mode=self.unix_listen_mode,
|
||||||
|
|
@ -819,7 +819,7 @@ class WebSockifyServer():
|
||||||
if lsock in ready:
|
if lsock in ready:
|
||||||
startsock, address = lsock.accept()
|
startsock, address = lsock.accept()
|
||||||
# Unix Socket will not report address (empty string), but address[0] is logged a bunch
|
# Unix Socket will not report address (empty string), but address[0] is logged a bunch
|
||||||
if self.unix_listen != None:
|
if self.unix_listen is not None:
|
||||||
address = [self.unix_listen]
|
address = [self.unix_listen]
|
||||||
else:
|
else:
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue