问题
Hi Angular 2/5/6 Gurus,
I was trying this, to get my machine's network IP address. But I got "localhost" as an IP address instead. I was expecting the result for this one to be like 10.0.5.21 for example.
Is there anyway I can get this?
Heaps of thanks to you guys!
Artanis Zeratul
回答1:
Try https://jsonip.com
this.http.get('https://jsonip.com/').subscribe(data => {
console.log(data);
});
来源:https://stackoverflow.com/questions/51924183/angular-5-getting-actual-network-ip-address