HTML JS Local IP of android on CLIENT side NOT Server side
lazarus / 38-Networking and Web Programming
----------------------------------------------------------------------
epergola · 2020-07-18 14:38
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 · 2020-07-18 14:54
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 · 2020-07-20 15:06
Thanks. In synapse is sock.GetRemoteSinIP.