https://github.com/web-platform-tests/wpt
Raw File
Tip revision: b55e29597d92ab89063673f031151e2bdb4b9479 authored by Joe Downing on 22 March 2018, 07:35:35 UTC
Move KeyboardLock API methods to a 'keyboard' object
Tip revision: b55e295
echo_raw_wsh.py
#!/usr/bin/python

from mod_pywebsocket import msgutil
import urllib


def web_socket_do_extra_handshake(request):
    pass  # Always accept.

def web_socket_transfer_data(request):
    while True:
        line = msgutil.receive_message(request)
        if line == 'exit':
            return
        request.connection.write(line.decode("string-escape"))
back to top