views:

41

answers:

1

I just went to a web site called fwix.com

I noticed that the page geolocates me based on my IP extremely quickly. At first, I simply thought they were doing this via Google Maps built in ClientLocation feature BUT it doesn't appear they are doing that.

Instead, looking at the source for the page, I see that my IP address has been injected into the <HEAD> as <meta name="client_ip" content="123.456.789.123" />

Question: How is fwix.com getting my IP and generating the web page accordingly?

+1  A: 

Getting the IP is trivial. The web server has to know your IP address in order to send you a response. There's no magic going on there, it's part of the TCP/IP protocol.

There are services that map known IP addresses or address blocks to geographic locations. They're simply looking up if there's a known location for your IP address in a big database. One such service is MaxMind. They even have a free database you can download and play around with.

deceze