Multiple Websocket connection between two backends

Viewed 126

I'm trying to connect two servers with websockets, but I need multiple websocket connections. So if a client communicates with server A it needs to establish a websocket connection for this client with server B. If another client connects, I need a second websocket connection from server A to server B.

Is something like this possible? I can't find any documentation on this.

Both servers are in python. I'm using the socketIO library.

import socketio
sio = socketio.Client()
sio.connect('xxx.xxx.xxx.xxx')

I would need to store the connection in a list, and then if a client requests something from server B, server A would need to look up the right connection and send the request to server B.

The reason for this is, that server B creates an instance for each WS connection, and destroys it on connection close.

Any suggestions?

0 Answers
Related