Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var webSocket = WS.connect("ws://127.0.0.1:8080");
- webSocket.on("socket/connect", function(session){
- console.log(session);
- //session is an Autobahn JS WAMP session.
- session.subscribe("pull_tips");
- session.publish("pull_tips", '{"device": "web", "token": "b132a3ebf7952bb8c0a0cfaf937679427776b41c"}');
- });
- webSocket.on("socket/disconnect", function(error){
- //error provides us with some insight into the disconnection: error.reason and error.code
- console.log("Disconnected for " + error.reason + " with code " + error.code);
- //location.reload();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement