Angular 5, Getting actual network IP Address

6.5k views Asked by At

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

There are 1 answers

1
Arghya Saha On BEST ANSWER

Try https://jsonip.com

this.http.get('https://jsonip.com/').subscribe(data => {
console.log(data);
});