Skip to content

Instantly share code, notes, and snippets.

@mkozjak
Created September 26, 2016 12:07
Show Gist options
  • Save mkozjak/b6eda55357ecde23de6f914e68b47bb2 to your computer and use it in GitHub Desktop.
Save mkozjak/b6eda55357ecde23de6f914e68b47bb2 to your computer and use it in GitHub Desktop.
var C = require("rpc-wsc")
var c = new C("ws://localhost:8080/rpc/1.0")
c.on("open", function() {
c.call("funcme", "foo").then(function(result) {
console.log(result)
c.close()
})
})
c.on("error", function(error) {
console.log("error:", error)
})
c.on("close", function() {
console.log("close")
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment