-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Currently, the WebsocketClientBuilder in websocket-ts does not expose any way to inject custom HTTP headers when establishing the WebSocket handshake. This makes it impossible to use bearer tokens or other header-based authentication schemes with the library out of the box.
Many API Gateway or proxy setups require clients to present an Authorization header (e.g. Bearer ) at handshake time. Without the ability to set headers, users must resort to embedding tokens in query parameters (which is less secure) or reimplementing the underlying connection logic themselves.
const client = new WebsocketClientBuilder()
.url("wss://example.com/socket")
.build();
// No API to add headers:
// client.withHeader("Authorization", `Bearer ${token}`) ← not supported
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request