no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / dom / websocket / tests / file_websocket_basic_wsh.py
blob050e7ccc106ccbe85739674de1e789c48f0783d3
1 from mod_pywebsocket import msgutil
4 def web_socket_do_extra_handshake(request):
5 # must set request.ws_protocol to the selected version from ws_requested_protocols
6 request.ws_protocol = request.ws_requested_protocols[0]
8 if request.ws_protocol == "error":
9 raise ValueError("Error")
10 pass
13 def web_socket_transfer_data(request):
14 while True:
15 line = msgutil.receive_message(request)
16 if line == "protocol":
17 msgutil.send_message(request, request.ws_protocol)
18 continue
20 if line == "resource":
21 msgutil.send_message(request, request.ws_resource)
22 continue
24 if line == "origin":
25 msgutil.send_message(request, request.ws_origin)
26 continue
28 msgutil.send_message(request, line)
30 if line == "end":
31 return