Examines the method and request headers in msg and determines
whether msg contains a valid handshake request.
If origin is non-null, then only requests containing a matching
"Origin" header will be accepted. If protocols is non-null, then
only requests containing a compatible "Sec-WebSocket-Protocols"
header will be accepted. If supported_extensions is non-null, then
only requests containing valid supported extensions in
"Sec-WebSocket-Extensions" header will be accepted.
Normally funcwebsocket_server_process_handshake
will take care of this for you, and if you use
soup.server.Server.addWebsocketHandler to handle accepting WebSocket
connections, it will call that for you. However, this function may
be useful if you need to perform more complicated validation; eg,
accepting multiple different Origins, or handling different protocols
depending on the path.
Examines the method and request headers in msg and determines whether msg contains a valid handshake request.
If origin is non-null, then only requests containing a matching "Origin" header will be accepted. If protocols is non-null, then only requests containing a compatible "Sec-WebSocket-Protocols" header will be accepted. If supported_extensions is non-null, then only requests containing valid supported extensions in "Sec-WebSocket-Extensions" header will be accepted.
Normally funcwebsocket_server_process_handshake will take care of this for you, and if you use soup.server.Server.addWebsocketHandler to handle accepting WebSocket connections, it will call that for you. However, this function may be useful if you need to perform more complicated validation; eg, accepting multiple different Origins, or handling different protocols depending on the path.