Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
node.js request.js为什么我的IP地址在更改?_Node.js_Http_Request - Fatal编程技术网

node.js request.js为什么我的IP地址在更改?

node.js request.js为什么我的IP地址在更改?,node.js,http,request,Node.js,Http,Request,只要对whatismyip.org做一个简单的GET请求,我每次都会得到一个不同的IP。如果它在我的浏览器中访问网站,它总是一样的。这是怎么回事?我只是在windows 7机器上本地运行node.js。我怎么可能使用不同的IP request('http://www.whatsmyip.org/', function (error, response, body) { if (!error && response.statusCode == 200) {

只要对whatismyip.org做一个简单的GET请求,我每次都会得到一个不同的IP。如果它在我的浏览器中访问网站,它总是一样的。这是怎么回事?我只是在windows 7机器上本地运行node.js。我怎么可能使用不同的IP

request('http://www.whatsmyip.org/', function (error, response, body) {
    if (!error && response.statusCode == 200) {
        res.render('index', {content:body;});
    }
});

我感觉像
http://www.whatsmyip.org
知道这是一个自动请求,正在跟踪我。xD

阅读IP地址正上方的HTML注释:

<!--
Please DO NOT program a bot to use this site to grab your IPs. It kills my server and thats not nice.
Just get some cheap or free web hosting and make your own IP-only page to power your bot.
Then you won't even have to parse any html, just load the IP directly - better for everyone!!
-->


看起来站点正在使用JavaScript更新页面上的跨距,因此如果您正在执行简单的HTTP请求,则该跨距将不会更新为正确的值。如果使用Web浏览器访问站点,但仅查看源(不使用任何更新的检查器)并刷新,则显示的IP看起来是随机的

您的浏览器是否配置为使用代理?如果你尝试用cURL点击URL会发生什么?你看到的IP地址有多不同?真的不同,你知道吗。我试过
http://whatismyipaddress.com
每次都是我的IP。我想
http://www.whatsmyip.org
实际上是在骗我。。。有人能证实这一点吗?很酷,我没有使用任何机器人。只是做一些测试的请求。