HTML5地理位置功能如何工作? [英] How HTML5 Geolocation Feature Works?
问题描述
浏览器如何知道我在哪里?
完全基于注册的IP地址?如果我在代理的后面呢?
这取决于浏览器及其设置。它可能使用GPS,基于WLAN AP的位置,IP位置或任何其他可能的定位方法。
浏览器在本地机器上运行,所以即使您'代理后面,它应该能够找到您的实际IP地址(除非安全功能阻止它被发送到地理位置服务器查找)。是否有任何浏览器足够聪明地处理NAT(本地机器具有私有IP)并查找网关的IP地址,我不知道。
How can the browser tell where I am?
Totally based on registered IP address? What if I'm behind a proxy?
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.
这篇关于HTML5地理位置功能如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!