Extracts connect_info and auth_token credentials for Phoenix.Socket.Transport
with full parity for non-cookie HTTP/3 WebTransport CONNECT upgrades.
Supported :connect_info keys:
:peer_data-%{address: ip, port: port, ssl_cert: ...}:uri-%URI{scheme: "https", ...}built from path, query, and:authority:user_agent- value of"user-agent"header:x_headers- all request headers starting with"x-"(lowercased names):trace_context_headers-"traceparent"/"tracestate"headers:auth_token- decoded token fromwt-protocol/sec-websocket-protocolheader or a pre-join:authframe (base64url.bearer.phx.<token>){:session, _}- always%{}on WebTransport (credentials: "omit"omits cookies, andPhoenix.LiveView.Channelrejects%{session: nil}as stale; usePhoenixWebTransport.Token+PhoenixWebTransport.Plugfor session claims){key, val}- arbitrary custom key/value pairs passed through unchanged
Summary
Functions
Builds the connect_info map for socket.connect/1 based on configured keys.
Decodes an auth_token credential from either a "base64url.bearer.phx.<b64>"
string (as emitted by phoenix.js) or a raw token binary when explicitly
sent in a pre-join :auth frame.
Extracts an optional Phoenix auth_token from CONNECT subprotocol headers
("wt-protocol" or "sec-websocket-protocol").
Finds the first header value matching lowercase name.
Types
Functions
Builds the connect_info map for socket.connect/1 based on configured keys.
Decodes an auth_token credential from either a "base64url.bearer.phx.<b64>"
string (as emitted by phoenix.js) or a raw token binary when explicitly
sent in a pre-join :auth frame.
Extracts an optional Phoenix auth_token from CONNECT subprotocol headers
("wt-protocol" or "sec-websocket-protocol").
Finds the first header value matching lowercase name.