My question is more general rather than specific. I want to implement a simple socket proxy server, where the server will receive requests from multiple clients, and forward it to another server using a single and unique connection, and the way back, the response comes to client.
The question is, can I keep a TCP connection open (maybe using ping?) and traffic the data inside it, so the final server will only count one connection? Like the example below.
client 1 - - -| | Single Con |
client 2 - - -| Proxy | --------> |Destination
client 3 - - -| Server | <-------- |Server
client 4 - - -| | |
Any suggestion or example?