Recent

Author Topic: HTML JS Local IP of android on CLIENT side NOT Server side  (Read 933 times)

epergola

  • Full Member
  • ***
  • Posts: 157
HTML JS Local IP of android on CLIENT side NOT Server side
« on: July 18, 2020, 04:38:15 pm »
Hi
I have an html markup on the android (with Chrome) device. The device is connected to my own server (synapse) on the PC through the router. I want to "register" this device in a database on the PC and store the device IP address. Therefore I want to get the LOCAL IP inside the html running on the device and send the info to he PC. Anybody has any idea? I searched a lot but all results talk about the SERVER not allowed, risk, security, etc. I want to fetch the IP within the html in the RAM of the device, the server has nothing to do with it.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: HTML JS Local IP of android on CLIENT side NOT Server side
« Reply #1 on: July 18, 2020, 04:54:36 pm »
You don't need to retrieve the IP from within your HTML. Your server component should be able to give you the peer or remote address of the request (which is the IP of your device), cause after all it needs to be able to send back a response. ;) I don't know what you need to do in Synapse for this, but it should be possible.

epergola

  • Full Member
  • ***
  • Posts: 157
Re: HTML JS Local IP of android on CLIENT side NOT Server side
« Reply #2 on: July 20, 2020, 05:06:14 pm »
Thanks. In synapse is sock.GetRemoteSinIP.

 

TinyPortal © 2005-2018