-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
I try to use interface option but it doesnt work. No error but gives me other interface's ip
var curl = new (require( 'curl-request' ))();
curl
.setOpt('interface', 'eth0')
.setHeaders([
'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36'
])
.get('www.wtfismyip.com/json')
.then(({statusCode, body, headers}) => {
console.log(statusCode,body)
})
.catch((e) => {
console.log(e);
});
It works on command tool with curl. I get the right ip with that command;
sudo curl -s http://www.wtfismyip.com/text --interface eth0
Metadata
Metadata
Assignees
Labels
No labels