I have a problem where I have an existing client server (socket based) application where the client makes a request and when the request is completed the server sends a notification back to the client.
Now the client is only able to connect to the server directly if the server is on host A. Some users want to be able to host the server on a different host which the clients cannot connect directly to for security configuration reasons.
My question is: will a proxy server fix this problem? Eg clients connect to what they think is the server but which is in fact the proxy server. But what happens to the source IP which is sent on to the real server? Will it still be the ip of the client? If so then my cunning plan using a proxy server will work. but if not everything will fail (I assume)?
Basically, question in simple terms is does a proxy server somehow fiddle the from: IP part of the packet so that recipient will send back any responses/messages to the actual client? Or does it work some other way?
My thinking is that the proxy makes a record of each client and the request. Eg ip: 1.1.1.1 wants GET google.com and then when response comes back from google.com proxy says it must be for 1.1.1.1 and forwards onto there. But I am not sure how this would work. Just looking for a high level design for how it works.
Can anyone clarify for me please?
Angus
If this is TCP, the response is normally sent back down the same connection the request came in by. No source IP address required. The server responds to the proxy, and the proxy responds to the client.