Soup.ServerMessage containing the client side of a WebSocket handshake
Optionalorigin: stringexpected Origin header
Optionalprotocols: string[]allowed WebSocket protocols.
Optionalsupported_extensions: TypeClass[]list of supported extension types
true if msg contained a valid WebSocket handshake, false and an error if not.
Examines the method and request headers in
msgand determines whethermsgcontains a valid handshake request.If
originis non-null, then only requests containing a matching "Origin" header will be accepted. Ifprotocolsis non-null, then only requests containing a compatible "Sec-WebSocket-Protocols" header will be accepted. Ifsupported_extensionsis non-null, then only requests containing valid supported extensions in "Sec-WebSocket-Extensions" header will be accepted.Normally websocket_server_process_handshake will take care of this for you, and if you use Server.add_websocket_handler 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.