Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I want to know when a browser includes the header - Remote_Addr in the HTTP request. I observed the request sent by the browser on loading stackoverflow.com, in the web console window of Firefox. There were no headers pertaining to IP address sent. So, does this mean the browser never sends this header along with a HTTP request?

share|improve this question
add comment

1 Answer

In client-server applications, the IP address of the client (i.e., the browser) is sent via the socket connection (the request) to the server (e.g., Apache). If the client is using a proxy server however, that may be the proxy's IP address instead of the client's IP.

Remote_Addr is an ENV returned by the server and available to server-side scripts/applications, not the client browser.

In PHP, you can use something like $_SERVER['REMOTE_ADDR'] to obtain the IP address of the client. In Perl you can use something like $ENV{'REMOTE_ADDR'};

share|improve this answer
    
I have deleted those comments. If the browser doesn't send the client IP then how does the Server get in the first place? –  Ashwin Jun 24 '13 at 2:53
1  
As I indicated, the client IP address is part of the connection - that's how a server knows where to send the data back to the client. It might be helpful to take a look at how socket communication occurs - see the diagram and information here: troubleshooters.com/codecorn/sockets –  dan Jun 24 '13 at 4:24
    
So, before the request is forwarded to the requested servlet/jsp, the server extracts the ip address from the network layer and adds a request header with the IP address. So, the server is modifying it at application layer? –  Ashwin Jun 24 '13 at 14:18
    
This is off-topic from your original question. I'd suggest asking a new one, perhaps in ServerFault. –  dan Jun 24 '13 at 19:21
    
I just want a yes or no and a brief answer. You still want me to post a new question on Server Fault? –  Ashwin Jun 25 '13 at 11:51
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.