admin管理员组文章数量:1410705
I want to obtain the remote client ip by javascript, not querying any external ip resource pools. how could i get the remote ip address, just like the way i get appName by navigator.appName
also like the ways as follows:
PHP:<?php echo $_SERVER["REMOTE_ADDR"]; ?>
NODE.JS: req.connection.remoteAddress
so green with javascript, and im trying to google with some keywords. yet i still can't find the result i want. any guy here could share his solution of the same desired scene? any tips or suggestions are wele.
platform:chrome, firefox
I want to obtain the remote client ip by javascript, not querying any external ip resource pools. how could i get the remote ip address, just like the way i get appName by navigator.appName
also like the ways as follows:
PHP:<?php echo $_SERVER["REMOTE_ADDR"]; ?>
NODE.JS: req.connection.remoteAddress
so green with javascript, and im trying to google with some keywords. yet i still can't find the result i want. any guy here could share his solution of the same desired scene? any tips or suggestions are wele.
platform:chrome, firefox
Share Improve this question edited Apr 19, 2013 at 14:27 Emil Ivanov 37.7k12 gold badges76 silver badges91 bronze badges asked Apr 19, 2013 at 14:19 Yi LingYi Ling 2873 silver badges11 bronze badges 2- possible duplicate of Get Client IP using just Javascript? – Ian Commented Apr 19, 2013 at 14:44
- yeap, the same problem(i had read it). but so pity the answers cannot help yet. thanks @Ian. – Yi Ling Commented Apr 19, 2013 at 14:54
2 Answers
Reset to default 3You can't know it on the client because the client doesn't know it. For example, if the client is behind a NAT, the IP of the machine will be different from the IP the "world" sees.
Make a simple server (AJAX) call that will return you the remote address.
This is not possible using pure Javascript without external calls.
本文标签: user agenthow to get browser39s remote ip by javascriptStack Overflow
版权声明:本文标题:user agent - how to get browser's remote ip by javascript? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745028162a2638330.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论