6

I receive real time data from websocket server (A). I want to forward that data using another websocket server (B) which will be used to share the data with client (web application).

Instead of relaying on websocket server (A). whenever I receive data from 'A', I will broadcast it to the client using 'B'.

SubscribeToServerA()
While True :
   Server_A_Callback() :
      BroadcastDataViaServerB()
  1. How feasible is this approach ?
  2. Is it good idea to store the data in some database when I received data in Server_A_Callback() ?

I'm complete in newbie to Websockets and Other stuff any other approaches and suggestions are welcome

anilkunchalaece
  • 388
  • 2
  • 10
  • Can you explain what the problem you are trying to solve? This mainly describes an idea for a solution – kmaork Jun 04 '20 at 21:41
  • I'm trying to establish websocket connection between two servers (A,B). B will get real time stream from A via web-sockets. As soon as B receives the data, it will emits same data to clients connected to it. I'm hope this is what you are asking. – anilkunchalaece Jun 04 '20 at 21:51
  • You are asking how feasible this approach is, but you provide no details about the restrictions and requirements. The only thing you did mention is needing the data to pass around in real time. You ask if it is a good idea to use a db, but that also depends on whatever you are trying to achieve. This question should be probably asked in software engineering stack exchange, and try to provide more details about your problem there. – kmaork Jun 04 '20 at 22:33
  • Thanks for reply. As a start I want to get / stream data ( from A ) and display it to clients using server B and perform some calculations on the data if possible (neglecting about any small delays (in seconds hopefully ) incurred in the middle). I'm still connecting bits and pieces and couldn't figureout starting point to begin with (Flask with flask-socket-io or tornado ? ). I will ask in software exchange. Thanks. – anilkunchalaece Jun 04 '20 at 23:01
  • @anilkunchalaece Is there any solution? I'm trying to do a similar thing you have mentioned. The WebSocket server B should act as both client and server. – Crazy-Kaleidoscope-7 Jul 06 '21 at 07:10

0 Answers0