sindresorhus / got

🌐 Human-friendly and powerful HTTP request library for Node.js
MIT License
14.31k stars 936 forks source link

Getting the IP address for failed requests due to timeout #2329

Open rjbma opened 9 months ago

rjbma commented 9 months ago

What would you like to discuss?

Is it possible to get the remote IP address when a timeout occurs?

827 implemented the possibility to get the IP address like so:

  response.ip (for successful calls)
  err.response.ip (for failed calls)

However, for timeouts there's no err.response, therefore we can't get the IP from there. Is there any way to get it? By the way, this is of course for the case that DNS lookup was successful, it's just the the remote server took too long to respond. ...

Checklist