Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/protocol / subprotocol / negotiateSubprotocol

Function: negotiateSubprotocol()

ts
function negotiateSubprotocol(clientList): string | null;

Defined in: subprotocol.ts:87

Pick the single subprotocol the server should echo back. Returns SUBPROTOCOL_NAME when the client offered it, or null when no compatible variant was advertised. The function ignores ticket.* tokens — those are handled separately via parseTicketSubprotocol.

Parameters

ParameterType
clientListstring | readonly string[]

Returns

string | null

Stable