Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nodejs #71

Open
theavijitsarkar opened this issue May 8, 2016 · 4 comments · May be fixed by #76
Open

Nodejs #71

theavijitsarkar opened this issue May 8, 2016 · 4 comments · May be fixed by #76

Comments

@theavijitsarkar
Copy link

Is this a nodejs library? How to use it in nodejs?
npm install ?

@rohozhnikoff
Copy link

@igracia
Copy link

igracia commented Oct 5, 2016

Issue #73 is pointing out that it assumes browser environment. Could this represent a problem when using the library in a server-side app?

@intensite
Copy link

How should the library be used as a node module?
I tried the following without success:

Installer from npm npm install --save reconnectingwebsocket

var ReconnectingWebSocket = require('reconnectingwebsocket');
ws = new ReconnectingWebSocket("ws://192.168.60.80/PSIA/Metadata/stream?AreaControlEvents=true");

The returned error message:

C:\projets\ws\app2.js:9
 ws = new ReconnectingWebSocket("ws://192.168.60.80/PSIA/Metadata/stream?AreaControlEvents=true");
       ^

TypeError: ReconnectingWebSocket is not a function
    at Object.<anonymous> (C:\projets\ws\app2.js:9:8)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:467:10)
    at startup (node.js:136:18)
    at node.js:963:3
[nodemon] app crashed - waiting for file changes before starting...

@nathanboktae
Copy link

This package is for the browser's implementation of WebSocket. Use the ws package for a node.js client WebSocket implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants