Mumba WAMP
Client and utilities for connecting to a Web Application Messaging Protocol (WAMP) service.
Installation
$ npm install --save mumba-wamp
Configuration
See Autobahn connection options.
Examples
;; ; // The main test instance.; instance.onError.subscribeconsole.error; instance.onOpen.subscribe; instance.onClose; instance.onSubscribe.subscribeconsole.log'Subscribed:', resp.topic, resp.id; instance.onRegister.subscribeconsole.log'Registered:', result.procedure, result.id; instance.openConnection;
Alternate initialisation path if an instance of the WampClient is needed before the connection options are known. For example a login page in a website that needs the user to enter their credentials before opening a socket connection.
; ... ; instance.setOptionsoptions .openConnection;...
Caching.
;; ;; ; instance .setCachecache .openConnection;...
API
WampSession.get
authid: '*admin' authrole: 'backend' authmethod: 'wampcra' authprovider: 'static' realm: 'test-realm' session: 1093244371 transport: type: 'websocket' protocol: 'wamp.2.json' peer: 'tcp4:127.0.0.1:50979' http_headers_received: connection: 'Upgrade' upgrade: 'websocket' host: '127.0.0.1:8080' 'sec-websocket-version': '13' 'sec-websocket-key': 'MTMtMTQ1MjMxODAyNzA2Mw==' 'sec-websocket-protocol': 'wamp.2.json' 'sec-websocket-extensions': 'permessage-deflate; client_max_window_bits' http_headers_sent: {}
Tests
To run the test suite, first install the dependencies, then run npm test
:
$ npm install$ npm run docker:up$ npm test$ npm run docker:down
References
People
The original author of Mumba WAMP is Andrew Eddie.
License
© 2016 Mumba Pty Ltd. All rights reserved.