pladaria / reconnecting-websocket

Reconnecting WebSocket. For Web, React Native, cli (Node.js)
MIT License
1.22k stars 197 forks source link

No valid WebSocket class provided #72

Closed SuperXFan closed 6 years ago

SuperXFan commented 6 years ago

in nodejs const ReconnectingWebSocket = require('reconnecting-websocket'); let ws = new ReconnectingWebSocket('ws://192.168.90.124:3002/ws');

then Error: No valid WebSocket class provided

gillesdemey commented 6 years ago

Node does not have a WebSocket class on the global namespace (like in the browser), so you have to use a module like ws and pass that as the class.

See example

PierBover commented 5 years ago

I'm getting this error on iOS 9, which AFAIK supports WebSocket since iOS 6.

https://caniuse.com/#search=websocket

Edit:

So we've made more tests and it is definitely a problem with reconnecting-websocket.

Web sockets work great on iOS 9.3.

WKWebView:

image

Safari:

image

pladaria commented 5 years ago

Please check with latest version, if the problem persists, please open a new issue