I would like to get the resolved IP address of the remote url when I make an axios call in Node. See *** comment below. Thanks a lot in advance!
axios.get('http://www.example.com')
.then(function (response) {
// *** How can I get the resolved IP address of www.example.com here
})
.catch(function (error) {
console.log(error);
});
The Axios documentation states response.request
"is the last ClientRequest instance in node.js (in redirects)."
axios.get('http://www.example.com')
.then(function (response) {
console.log(response.request.socket.remoteAddress);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With