Skip to content

Use subprotocols to send headers in browser WebSocket#490

Merged
uezo merged 1 commit intomasterfrom
develop
Feb 14, 2026
Merged

Use subprotocols to send headers in browser WebSocket#490
uezo merged 1 commit intomasterfrom
develop

Conversation

@uezo
Copy link
Owner

@uezo uezo commented Feb 14, 2026

Browser WebSocket API doesn't support custom headers, so encode provided headers as subprotocols of the form {Key}.{Base64URL(Value)} and pass that list to the WebSocket constructor. If a header value starts with "Bearer ", the prefix is stripped before encoding.

Browser WebSocket API doesn't support custom headers, so encode provided headers as subprotocols of the form {Key}.{Base64URL(Value)} and pass that list to the WebSocket constructor.
If a header value starts with "Bearer ", the prefix is stripped before encoding.
@uezo uezo merged commit 08cece1 into master Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant