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