File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ class WebSocketsHandler(SocketServer.StreamRequestHandler):
8484 def setup (self ):
8585 global clients
8686 SocketServer .StreamRequestHandler .setup (self )
87- print 'websocket connection established' , self .client_address
87+ print ( 'websocket connection established' , self .client_address )
8888 self .handshake_done = False
8989
9090 def handle (self ):
@@ -133,7 +133,7 @@ def handshake(self):
133133 headers = Message (StringIO (data .split ('\r \n ' , 1 )[1 ]))
134134 # if headers.get("Upgrade", None) != "websocket":
135135 # return
136- print 'Handshaking...'
136+ print ( 'Handshaking...' )
137137 key = headers ['Sec-WebSocket-Key' ]
138138 digest = b64encode (sha1 (key + self .magic ).hexdigest ().decode ('hex' ))
139139 response = 'HTTP/1.1 101 Switching Protocols\r \n '
@@ -152,7 +152,7 @@ def on_message(self, message):
152152 if not self in clients [k ].websockets :
153153 clients [k ].websockets .append (self )
154154 print ('on_message\n ' )
155- print 'recv from websocket client: ' + message
155+ print ( 'recv from websocket client: ' + message )
156156
157157 # parsing messages
158158 chunks = message .split ('/' )
You can’t perform that action at this time.
0 commit comments