简体   繁体   English

Node.js http.request失败并显示[错误:getaddrinfo EADDRINFO]

[英]Node.js http.request fails with [Error: getaddrinfo EADDRINFO]

I have node.js server which acts like a proxy. 我有node.js服务器,它像一个代理。 It receives requests and forwards them to web service on another domain, by executing http.request. 它通过执行http.request接收请求并将它们转发到另一个域上的Web服务。

Request options usually are similar to: 请求选项通常类似于:

{
  "host": "some.domain",
  "port": 443,
  "path": "/paht/item/id",
  "method": "POST",
  "headers": {
    "Host": "some.domain",
    "Content-Type": "application/json; charset=utf-8",
    "Content-Length": 100
  }
}

Lately, I've noticed that some requests fail with [Error: getaddrinfo EADDRINFO] , but not all of them. 最近,我注意到一些请求失败了[Error: getaddrinfo EADDRINFO] ,但不是全部。

Does anyone know what EADDRINFO means, and what the alleged cause can be? 有谁知道EADDRINFO含义,以及所谓的原因是什么?

EAADRINFO is an error type that can occur when looking up a host name's IP address for the case where an IP address cannot be found. EAADRINFO是在无法找到IP地址的情况下查找主机名的IP地址时可能出现的错误类型。 So here it likely means that the "some.domain" value of the request can't be resolved to an IP address. 所以这里可能意味着请求的"some.domain"值无法解析为IP地址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM