WAMP Implementation wrapper
Thin wrapper around cjs-wamp module.
Installation
npm install spa-wamp
Usage
Add the constructor to the scope:
var Wamp = ;
Create a WAMP connection:
var wamp = 'ws://echo.websocket.org';
Wait for an open state to exec remote method and serve remote request:
wamp { wamp; wamp;};
Catch a connection loss and automatically reconnect:
wamp { console;};
Create a WAMP instance with increased reconnection time:
var wamp = 'ws://echo.websocket.org' timeout: 30000;
Timeout can be changed for all instances at once:
Wampprototypetimeout = 30000;
To disable automatic reconnection set timeout
to 0;
It's possible to work directly with original WebSocket connection (but messaging should be avoided):
// okwampsocket;// not recommendedwampsocket;
Contribution
If you have any problem or suggestion please open an issue here. Pull requests are welcomed with respect to the JavaScript Code Style.
License
spa-wamp
is released under the MIT License.