wamp-protocol

How to send Autobahn/Twisted WAMP message from outside of protocol?

浪尽此生 提交于 2019-12-01 05:22:21
I am following the basic wamp pubsub examples in the github code : This example publishes messages from within the class: class Component(ApplicationSession): """ An application component that publishes an event every second. """ def __init__(self, realm = "realm1"): ApplicationSession.__init__(self) self._realm = realm def onConnect(self): self.join(self._realm) @inlineCallbacks def onJoin(self, details): counter = 0 while True: self.publish('com.myapp.topic1', counter) counter += 1 yield sleep(1) I want to create a reference so that I can publish messages over this connection from elsewhere

Connecting to Poloniex Push-API

爱⌒轻易说出口 提交于 2019-11-30 15:38:50
问题 I want to connect to the Push API of Poloniex. On their page they write the following: In order to use the push API, connect to wss://api.poloniex.com and subscribe to the desired feed. wss = WebSocket Secure -> SSL Protected They also give an example for Node.js and Autobahn|JS: var autobahn = require('autobahn'); var wsuri = "wss://api.poloniex.com"; var connection = new autobahn.Connection({ url: wsuri, realm: "realm1" }); connection.onopen = function (session) { function marketEvent (args

Connecting to Poloniex Push-API

我是研究僧i 提交于 2019-11-30 15:25:20
I want to connect to the Push API of Poloniex . On their page they write the following: In order to use the push API, connect to wss://api.poloniex.com and subscribe to the desired feed. wss = WebSocket Secure -> SSL Protected They also give an example for Node.js and Autobahn|JS: var autobahn = require('autobahn'); var wsuri = "wss://api.poloniex.com"; var connection = new autobahn.Connection({ url: wsuri, realm: "realm1" }); connection.onopen = function (session) { function marketEvent (args,kwargs) { console.log(args); } function tickerEvent (args,kwargs) { console.log(args); } function