Merge remote branch 'upstream/master', after #110 was merged.

This commit is contained in:
Peter Åstrand (astrand) 2013-12-16 16:18:41 +01:00
commit f64e3dea51
5 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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,