tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

websocket_backend_wsh.py (607B)


      1 from mod_pywebsocket import msgutil
      2 
      3 
      4 def web_socket_do_extra_handshake(request):
      5    pass
      6 
      7 
      8 def web_socket_transfer_data(request):
      9    while not request.client_terminated:
     10        resp = msgutil.receive_message(request)
     11        msgutil.send_message(request, resp)
     12 
     13 
     14 def web_socket_passive_closing_handshake(request):
     15    # If we use `pass` here, the `payload` of `frameReceived` which will be happened
     16    # of communication of closing will be `\u0003รจ`. In order to make the `payload`
     17    # to be empty string, return code and reason explicitly.
     18    code = None
     19    reason = None
     20    return code, reason