Have anyone used ZmqSocket.js successfully? I\'d like to know how can it be used to establish a safe channel between the browser and a zeromq server app. Is there other/better o
Another perspective: implementing a WebSocket-to-ZeroMQ proxy that handles all of ZeroMQ's strategies seems like a lot of work, but you can very quickly get a partial proxy running. Like Emil, I'm experimenting with a PyZMQ <--Tornado--> WebSocket bridge; in my case I only care about getting messages from SUB sockets.
In my model, I send JSON messages from the browser to the proxy, requesting the creating of new ZMQ sockets. When these sockets receive data, they send it back to the browser over the same WebSocket connection.
Here's the python proxy backend, and my javascript proxy frontend. In my Python code, the AsyncReciever
class is a very thin wrapper around a ZMQStream
that basically runs JSON encode/decode. If you want to send raw ZeroMQ bytes to the browser, things would be even easier: just connect a ZMQSocket.on_message
callback directly to BridgeWebSocket.write_message
.