multiple simultaneous websockets connections to one binance data stream

95 views Asked by At

I have read the documentation, but did find an answer, in Websocket and binance api. Is it possible to set up several distinct connections to one concrete data stream of ticker? I have read about rel, but I am not quite confident it is the thing I need.

import websocket, rel
addr = "wss://api.gemini.com/v1/marketdata/%s"
for symbol in ["ETHUSD", "ETHUSD"]:
    ws = websocket.WebSocketApp(addr % (symbol,), on_message=lambda w, m : print(m))
    ws.run_forever(dispatcher=rel, reconnect=3)  
rel.signal(2, rel.abort)    
rel.dispatch() 
0

There are 0 answers