The current implementation of the WebSocket API in Emscripten does not provide a way to set custom headers. This limitation poses challenges for use-cases where custom headers are required for WebSocket connection initialization, such as authentication.
A method should exist that allows the user to set custom headers when initializing a WebSocket connection.
Currently, there is no way to set custom headers for a WebSocket connection via Emscripten's API.
Adding the ability to set custom headers would align Emscripten more closely with the standard WebSocket API and would enable a broader range of use-cases.
Original discussion: #19189