Created
August 16, 2017 15:17
-
-
Save nutrino/b926a26d72365a114c61325681f5b02a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var autobahn = require('autobahn'); | |
| var connection = new autobahn.Connection({url: 'ws://127.0.0.1:8080/ws', realm: 'realm1'}); | |
| connection.onopen = function (session) { | |
| console.log("opened " + session); | |
| // 4) call a remote procedure | |
| session.call('com.math.slowsquare', [3]).then( | |
| function (res) { | |
| console.log("SlowSquare: ", res); | |
| } | |
| ); | |
| session.call('tupleTestAsync', [4,5,6]).then( | |
| function (res) { | |
| console.log("TupleTestAsync: ", res); | |
| } | |
| ); | |
| session.call('dictTestAsync', [{'a': 2}]).then( | |
| function (res) { | |
| console.log("DictTestAsync: ", res); | |
| } | |
| ); | |
| session.call('com.math.square', [3]).then( | |
| function (res) { | |
| console.log("QuickSquare: ", res); | |
| } | |
| ); | |
| session.call('tupleTest', [4,5,6]).then( | |
| function (res) { | |
| console.log("TupleTest: ", res); | |
| } | |
| ); | |
| console.log("called"); | |
| }; | |
| connection.open(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment