I'm using webpack to build a simple app which sets up a BinaryClient. As soon as the client is created I get this error, when running on a localhost test server:
Refused to set unsafe header "sec-websocket-version":
I think it's because the connection gets started as an http. I ran the hello world example and everything is fine, and i see ws:// request in the network logs. I set up my client like so
this.client = new BinaryClient('ws://localhost:9000/audio');
I have /audio routed to my BinaryServer.
I'm pretty sure it's this line that's responsible in ws setting the header
https://github.com/websockets/ws/blob/master/lib/WebSocket.js#L611
And the connection starts with an httpObj
https://github.com/websockets/ws/blob/master/lib/WebSocket.js#L683
I don't understand why this is not working, and why the connection is http. In FF the connection still fails as an http GET request, but the header errors are not there.
Could somebody help? Also is this project still active? I may switch to socket.io-stream which seems to be more active
https://www.npmjs.com/package/socket.io-stream
Thanks
I'm using webpack to build a simple app which sets up a BinaryClient. As soon as the client is created I get this error, when running on a localhost test server:
Refused to set unsafe header "sec-websocket-version":
I think it's because the connection gets started as an http. I ran the hello world example and everything is fine, and i see ws:// request in the network logs. I set up my client like so
this.client = new BinaryClient('ws://localhost:9000/audio');
I have /audio routed to my BinaryServer.
I'm pretty sure it's this line that's responsible in ws setting the header
https://github.com/websockets/ws/blob/master/lib/WebSocket.js#L611
And the connection starts with an httpObj
https://github.com/websockets/ws/blob/master/lib/WebSocket.js#L683
I don't understand why this is not working, and why the connection is http. In FF the connection still fails as an http GET request, but the header errors are not there.
Could somebody help? Also is this project still active? I may switch to socket.io-stream which seems to be more active
https://www.npmjs.com/package/socket.io-stream
Thanks