websocket_server_process_handshake_with_extensions


Description:


[ Version ( since = "2.68" ) ]
public bool websocket_server_process_handshake_with_extensions (Message msg, string? expected_origin, string[]? protocols, GenericArray<TypeClass>? supported_extensions, out List<WebsocketExtension> accepted_extensions)

Examines the method and request headers in msg and (assuming msg contains a valid handshake request), fills in the handshake response.

If expected_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. The accepted extensions will be returned in accepted_extensions parameter if non-%NULL.

This is a low-level function; if you use add_websocket_handler to handle accepting WebSocket connections, it will call this for you.

Parameters:

msg

Message containing the client side of a WebSocket handshake

expected_origin

expected Origin header

protocols

allowed WebSocket protocols.

supported_extensions

list of supported extension types

accepted_extensions

a List of WebsocketExtension objects

Returns:

true if msg contained a valid WebSocket handshake request and was updated to contain a handshake response. false if not.


Namespace: Soup
Package: libsoup-2.4