Get user local ip address

I have people on a local intranet accessing my Shiny website. When I use PHP, I am able to get their local IP address with the PHP command: $_SERVER[‘REMOTE_ADDR’]

Is there a way to get the local IP address with Shiny?

Hi FSchiro,

as I know there is no official way to get IP from ShinyProxy user.

I saw few examples where people are using JavaScript or access to some “whatIsMyIP” sites from R code. But this works not in all cases. If you are behind reverse-proxy it does not work and you get wrong IP address (usually some from server local network gateway). Also additional problem make containerization of ShinyProxy.

Only way I succeeded to proper catch user IP was using Keycloak for authentication and asking Keycloak API from R code. Sounds complicated but works and it is little bit slow, but you do it just once during lifetime of container.