Node.js Error: connect ECONNREFUSED when using http.request
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am troubleshooting a Node.js script, and have stripped out almost all of the code and still am able to reproduce the following error: { [Error: connect ECONNREFUSED] stack: 'Error: connect ECONNREFUSED at exports._errnoException (util.js:682:11) at Object.afterConnect [as oncomplete] (net.js:947:19)', code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect' } The entire script is: var http = require('http'); http.get("http://api.hostip.info/get_json.php", function(res) { console.log("Received response: " + res.statusCode); }); var