ECONNREFUSED error with node.js that does not occur in other clients

前端 未结 5 1822
面向向阳花
面向向阳花 2020-12-30 21:42

I\'m making an http request with the node.js client, and I get an ECONNREFUSED error. When I make what appears to be the same request

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-30 22:20

    I just faced the same problem.

    Note that Windows 7 by default doesn't include an entry for localhost in C:\Windows\System32\drivers\etc\hosts (wikipedia reference)

    Adding the entry for localhost has no effect with Node.js (0.10.25) as it apparently skips the hosts file completely.

    Use 127.0.0.1 as local address instead, this will works what ever is in your hosts file.

提交回复
热议问题