protocol_wsh.py (308B)
1 #!/usr/bin/python 2 3 from pywebsocket3 import msgutil 4 5 def web_socket_do_extra_handshake(request): 6 request.ws_protocol = request.headers_in.get('sec-websocket-protocol') 7 #pass 8 9 def web_socket_transfer_data(request): 10 while True: 11 msgutil.send_message(request, request.ws_protocol) 12 return