reconnecting-websocket icon indicating copy to clipboard operation
reconnecting-websocket copied to clipboard

Nodejs

Open theavijitsarkar opened this issue 8 years ago • 4 comments

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

theavijitsarkar avatar May 08 '16 14:05 theavijitsarkar

https://www.npmjs.com/package/reconnectingwebsocket

rohozhnikoff avatar Jul 03 '16 14:07 rohozhnikoff

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

igracia avatar Oct 05 '16 09:10 igracia

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...

intensite avatar Nov 24 '16 19:11 intensite

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

nathanboktae avatar Dec 12 '16 23:12 nathanboktae