The server that I am working with requires the Sec-WebSocket-Protocol request header field be set to a non-standard (not registered) subprotocol in the client request to upgrade to WebSockets. No matter what I've tried, I can't seem to get that added to the header issued by a WebSocket node. Any suggestions?
I'm having exactly the same problem. Did you ever find a solution?
ws = new WebSocket("ws://myserver", ["protocolName"]);
Node-RED gets a 403 response because it can only do:
ws = new WebSocket("ws://myserver");
The WebSocket node doesn't provide any way to modify the headers of the request. There is an item on the backlog to allow it to do so, but it isn't something being looked currently.
I solved my immediate problem by installing a modified version of the WebSocket node with the protocol value I needed hard-coded. It worked great. 15 seconds to modify the code, 2 hours to get it running in parallel to the production version. From this experience, I estimate it would take about 20 minutes of work to expose this parameter to the control panel.
Very happy to consider a pull request. Thanks.