Closed vincent714 closed 7 years ago
Do you have the same issue using a regular WebSocket?
I'm having the same issue. Actually here is a pretty small test case:
import WebSocket from 'reconnecting-websocket'
let ws = new WebSocket('wss://echo.websocket.org', null)
Without the second argument it works correctly.
According to the spec, the second argument must be a string
or an array of strings
:
https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
If you don't want to set it, use undefined
Test here: http://requirebin.com/?gist=d5d5e8aa7a31de1a4e4810a055c6c46d
I set up the new object as follows,
but in the Chrome console, it showed:
Error during WebSocket handshake: Sent non-empty 'Sec-WebSocket-Protocol' header but no response was received
I don't have any idea to fix it. Can someone help me? Thanks.