Closed binarykitchen closed 8 years ago
FYI this is my app code calling your websocket function https://github.com/binarykitchen/videomail-client/blob/develop/src/wrappers/visuals/recorder.js#L379
I guess it is related to https://github.com/socketio/engine.io-client/pull/375
If protocols is undefined, do not pass it onto the native constructor!
@mcollina
From https://www.w3.org/TR/2011/WD-websockets-20110419/#the-websocket-interface:
The WebSocket(url, protocols) constructor takes one or two arguments. The first argument, url, specifies the URL to which to connect. The second, protocols, if present, is either a string or an array of strings. If it is a string, it is equivalent to an array consisting of just that string; if it is omitted, it is equivalent to the empty array. Each string in the array is a subprotocol name.
I think that protocols
variable needs to be omitted if protocols
is empty, but only in Browsers.
@binarykitchen would you mind sending a PR?
Here you go https://github.com/maxogden/websocket-stream/pull/83
Please review and be aware that https://www.w3.org/TR/2011/WD-websockets-20110419/#the-websocket-interface also does not mention of options, hence I omitted them too, but only for native WebSocket implementations.
All tested on my side, everything passes.
thanks for the comments inside the PR. have updated my PR slightly. please re-check.
Probably fixed.
I have same issue.
This error is thrown at this line
(https://github.com/maxogden/websocket-stream/blob/master/stream.js#L30)
parameters were
User-Agent is
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36
Any ideas?