Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does a website know your ip address? [closed]

Tags:

http

When I visited the website http://myipaddress.com/what-is-my-ip-address/

I checked the request header information. No where does it include my ip address. So how is the web server able to determine my ip address? I know that any web server has access to this information. But if its not there in the HTTP request, how do they get it?

like image 353
developer747 Avatar asked Nov 18 '25 12:11

developer747


1 Answers

You're connecting to the server and sending it an HTTP request. The server replies with a page. To do that, it has to know where to send the reply to. That information is automatically available from the socket connection (i.e. from a lower level than HTTP), so it doesn't have to be repeated in the request headers.

Edit: If you want to know more about how the web server does this, see the accept function. When a connection comes in, the web server calls accept, which automatically provides it with the address of the other side.

like image 71
melpomene Avatar answered Nov 20 '25 02:11

melpomene