blob: 4faa42aa4524723406b8bbe6ce7b60e715ab6a20 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#!/usr/bin/python
import sys, urllib, time
from pywebsocket3 import msgutil
def web_socket_do_extra_handshake(request):
time.sleep(10)
return
def web_socket_transfer_data(request):
while True:
line = msgutil.receive_message(request)
if line == 'Goodbye':
return
request.ws_stream.send_message(line, binary=False)
|