Node.js http.request失败,并显示[错误:getaddrinfo EADDRINFO] [英] Node.js http.request fails with [Error: getaddrinfo EADDRINFO]

查看:272
本文介绍了Node.js http.request失败,并显示[错误:getaddrinfo EADDRINFO]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有充当代理的node.js服务器.通过执行http.request,它接收请求并将它们转发到另一个域上的Web服务.

I have node.js server which acts like a proxy. It receives requests and forwards them to web service on another domain, by executing http.request.

请求选项通常类似于:

{
  "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
  }
}

最近,我注意到有些请求因[Error: getaddrinfo EADDRINFO]失败,但并非全部.

Lately, I've noticed that some requests fail with [Error: getaddrinfo EADDRINFO], but not all of them.

有人知道EADDRINFO是什么意思,以及所谓的原因可能是什么?

Does anyone know what EADDRINFO means, and what the alleged cause can be?

推荐答案

EAADRINFO是一种错误类型,在找不到IP地址的情况下查找主机名的IP地址时可能会发生.因此,这很可能意味着请求的"some.domain"值无法解析为IP地址.

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. So here it likely means that the "some.domain" value of the request can't be resolved to an IP address.

这篇关于Node.js http.request失败,并显示[错误:getaddrinfo EADDRINFO]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆