Merge remote branch 'upstream/master', after #110 was merged.
This commit is contained in:
commit
f64e3dea51
|
|
@ -98,7 +98,7 @@ Sec-WebSocket-Accept: %s\r
|
||||||
|
|
||||||
begin
|
begin
|
||||||
t[:client] = do_handshake(io)
|
t[:client] = do_handshake(io)
|
||||||
new_client(t[:client])
|
new_websocket_client(t[:client])
|
||||||
rescue EClose => e
|
rescue EClose => e
|
||||||
msg "Client closed: #{e.message}"
|
msg "Client closed: #{e.message}"
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ Traffic Legend:
|
||||||
end
|
end
|
||||||
|
|
||||||
# Echo back whatever is received
|
# Echo back whatever is received
|
||||||
def new_client(client)
|
def new_websocket_client(client)
|
||||||
|
|
||||||
msg "connecting to: %s:%s" % [@target_host, @target_port]
|
msg "connecting to: %s:%s" % [@target_host, @target_port]
|
||||||
tsock = TCPSocket.open(@target_host, @target_port)
|
tsock = TCPSocket.open(@target_host, @target_port)
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ require 'websocket'
|
||||||
class WebSocketEcho < WebSocketServer
|
class WebSocketEcho < WebSocketServer
|
||||||
|
|
||||||
# Echo back whatever is received
|
# Echo back whatever is received
|
||||||
def new_client(client)
|
def new_websocket_client(client)
|
||||||
|
|
||||||
cqueue = []
|
cqueue = []
|
||||||
c_pend = 0
|
c_pend = 0
|
||||||
|
|
|
||||||
|
|
@ -124,4 +124,4 @@ class WebSocketProxyTest(unittest.TestCase):
|
||||||
return ins, outs, excepts
|
return ins, outs, excepts
|
||||||
|
|
||||||
self.stubs.Set(select, 'select', mock_select)
|
self.stubs.Set(select, 'select', mock_select)
|
||||||
self.assertRaises(Exception, web_socket_proxy.new_client)
|
self.assertRaises(Exception, web_socket_proxy.new_websocket_client)
|
||||||
|
|
|
||||||
|
|
@ -893,7 +893,7 @@ class WebSocketServer(object):
|
||||||
"""
|
"""
|
||||||
Daemonize if requested. Listen for for connections. Run
|
Daemonize if requested. Listen for for connections. Run
|
||||||
do_handshake() method for each connection. If the connection
|
do_handshake() method for each connection. If the connection
|
||||||
is a WebSockets client then call new_client() method (which must
|
is a WebSockets client then call new_websocket_client() method (which must
|
||||||
be overridden) for each new client connection.
|
be overridden) for each new client connection.
|
||||||
"""
|
"""
|
||||||
lsock = self.socket(self.listen_host, self.listen_port, False,
|
lsock = self.socket(self.listen_host, self.listen_port, False,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue