Angular 5, Getting actual network IP Address

北慕城南 提交于 2020-07-07 05:51:14

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!