I'm looking for ideas how to implement some sort of TCP relay server.
How it should work is something like (each request):
- Client sends a request to the Relay-Server.
- Relay-Server processes that request.
- The processed request is sent forward as a request to the Target-Server.
- Target-Server replies to the request, and the Relay-Server receives this reply.
- Relay-Server processes the reply.
- The processed reply is sent forward to the original Client.
Basically the Relay-Server works as a receiver for requests from Client and forwards it to a Target-Server, which will reply.
This is some sort of a proxy, but where I need to modify the requests from Client and responses of Target-Server. So, some sort of proxy-interpreter.
Any ideas how to mingle these two together, Server and Client?
Oh yea, it should be able to handle thousands of clients