On Sun, 20 Mar 2022 23:33:56 +0100, Micha <micha.faul@xxxxxx> wrote: >Indeed, it is the basic concept of a NAT that external servers only see >the public IP of the router and not the private LAN IP of the client >behind the NAT. > >An alternative of passing the local IP as URL parameter/query string, is >to pass it as custom request header. > >Best regards, > >Micha This means that the device address is hidden from view.... I had hoped that some header item would be this address in order to facilitate some kind of callback. Of course I do not intend to call back at all but rather find the local LAN address of the switch. The device is an IoT type gadget so it is not using any browser or such when sending data, just minimalistic http code, I believe... If I can get the IP address then I can (on that local LAN) connect to the switch's own webpage for configuration purposes and also to read out actual state data... > >Am 20.03.2022 um 23:10 schrieb Aziz Saleh: >> You can not access a request's internal IP with PHP. Maybe you can >> configure the switch to pass the IP as a parameter in the action URL. No, I have no way of doing anything such as adding parameters to the URL that comes from the device. I believe I have to configure the URL text verbatim and I am doing so when I have contacted the switch's built-in config page. But the idea is to set up the wifi connection data so it will connect on a different LAN and then it should send its connection IP so I can talk to it via the LAN and command on/off actions. But I guess I have to let that idea go now. :( >> On Sun, Mar 20, 2022 at 6:03 PM Hans Åhlin <ahlin.hans@xxxxxxxxxxxxxx> >> wrote: >> >> 'SERVER_ADDR' >> The IP address of the server under which the current script is >> executing. >> >> https://www.php.net/manual/en/reserved.variables.server.php >> >> MvH / Hans Åhlin I do not want the IP address of my webserver but instead the client device's local LAN address... -- Bo Berglund Developer in Sweden