How to get computer name or IP address from javascript?

I want to get the computer name or its IP address through javascript.

How can I get this?

+4
source share
2 answers

As Imran and Jamie said, you cannot do this completely on the client.

It is trivial to make the computer look like a public IP address - but only if you send a request to your server, either using XmlHTTPRequest , or adding a script tag to the head section or similar. The server can respond to this request by repeating the IP address at which the request apparently came. How you get this information depends on your server technology.

This will give you an IP address (using a server request), but I don't know how to get the computer name.

+4
source

It's impossible. JavaScript does not have access to the browser sandbox.

0
source

Source: https://habr.com/ru/post/1309634/


All Articles