How HTML5 Geolocation Feature Works?

前端 未结 4 563
慢半拍i
慢半拍i 2020-12-15 19:26

How can the browser tell where I am?

Totally based on registered IP address? What if I\'m behind a proxy?

4条回答
  •  太阳男子
    2020-12-15 19:49

    That would depend on the browser and its settings. It might use GPS, WLAN AP-based location, IP location, or any other conceivable method of locating itself.

    The browser runs on your local machine, so even if you're behind a proxy, it should be able to find your actual IP address (unless security features prevent it from being sent for lookup to a geolocation server). Whether any browser is smart enough to handle being behind a NAT (with the local machine having a private IP) and looking up the gateway's IP address, that I don't know.

提交回复
热议问题