Imagine the following:
User goes to script (
http://sample.org/test.php
),Script sends an HTTP request to some other page (
http://google.com/
). For this example, we'll say usingcurl
.The script sets the IP address of the request to the user's IP, via
CURLOPT_INTERFACE
.
I know already that the requesting script will not receive the response, as the remote-host will send any responses to the IP address given in the request.
What I am wondering is what happens to this response? Assuming the client is on a LAN that has one external address and that all traffic sent to that IP is handled by a router acting as a DHCP server, will the response even get back to the user's machine? If it did, would there be any way to ensure that it was handled by the user's browser? And if so, how would the browser handle this, typically? Would it open a new window with Google in it?
I definitely have a follow up to this question, but I am very curious what goes on at this level, before I experiment further.