mirror of
https://github.com/novnc/noVNC.git
synced 2026-06-07 12:54:37 +00:00
Add listen address to proxy (C and python).
This allows forwarding from an external port to the same port on localhost (loopback). I.e. ./utils/wsproxy `hostname -f`:5901 localhost:5901
This commit is contained in:
@@ -101,10 +101,10 @@ def do_handshake(sock):
|
||||
retsock.send(server_handshake % (origin, scheme, host, path))
|
||||
return retsock
|
||||
|
||||
def start_server(listen_port, handler):
|
||||
def start_server(listen_port, handler, listen_host=''):
|
||||
lsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
lsock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
lsock.bind(('', listen_port))
|
||||
lsock.bind((listen_host, listen_port))
|
||||
lsock.listen(100)
|
||||
while True:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user