Hi. I have a websocket to which I would like to connect with a subpotocol. In js is something like this new WebSocket(url, protocol). I have tried with both the built in and the experimental ws versions things like sending paramaters like this:
const response = ws.connect(url, {
headers: {
'Sec-WebSocket-Protocol': protocol
}
}, function (socket) { ...
or
const response = ws.connect(url, {
protocol: protocol
}, function (socket) { ...
but it does not work. I’ll appriciate any help to know how to start a websocket connection with a subprotocol.