Discover the User Hostname

Asked

Viewed 336 times

5

I have an application Running with Angularjs where I need to know the name of the machine (user) that is accessing the application. Someone has already had to do this with javascript?

Note: The front end is outside my local network

  • I believe that for security reasons Javascript is not allowed access to the client’s disk and/or system.

  • Because it’s @Lucas Costa, I think I’m gonna have to figure out another way. When the front-end was in my local network I could get the name good, but now that it is in AWS is no longer working.

  • 1

    You will need to use some back-end technology, such as Node.js or Java, as alternatives to your mission :P

  • Aham, I already use Spring in the backend.

  • @Danilo Silva can show how to pick up the hostname name of the user’s machine within a local network?

1 answer

4


TL;DR: Is not possible.

Long version: For safety reasons (environmental isolation), none of the objects provided by current Ecmascript implementations include information of the environment itself - only those historically inherited, such as OS version and platform (via window.Navigator).

Technologies such as reverse DNS can be used if the server receiving the connection has a direct connection to the client (no gateways, Vpns or intermediate Nats, for example).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.