1

I want to create a shinyApp that runs just locally, i.e. withouth a URL that can be accessed by others.

Here a minimal example:

library(shiny)
ui <- fluidPage("Some app")
server <- function(input, output) {}
shinyApp(ui = ui, server = server)

While running this, the console says:

console

If I type the URL into my browser, I see the App I am writing on. How can I hinder the app to go online? This is important for my use case because we handle sensible data which must remain locally.

ismirsehregal
  • 30,045
  • 5
  • 31
  • 78
LulY
  • 976
  • 1
  • 9
  • 24
  • ? This is local port ? So you are not online?! – TarJae Jul 26 '22 at 07:56
  • @TarJae How do I know this or to put it the other way around: What does "Listening on http://..." mean if not online? – LulY Jul 26 '22 at 07:58
  • So I see you have to go through some basic (no offense), I had to do it also and still I am not that clear about all this server side, local etc... So my tip is to start with , but more important is that you understand how you can make your app public accessable. Then you will understand what is local and what is public. Think of a local network in your company where all of your members have access to your app, but no one outside the company etc..... – TarJae Jul 26 '22 at 08:03
  • 2
    Please see [this](https://en.wikipedia.org/wiki/Loopbackand) and [this](https://en.wikipedia.org/wiki/Localhost). – ismirsehregal Jul 26 '22 at 08:05
  • 2
    @ismirsehregal Thanks (yo, vieles ist egal ;-) ) – LulY Jul 26 '22 at 08:09
  • 1
    Just ignore the downvotes. Mission is to learn! Never give up!!! Have fun! :-) – TarJae Jul 26 '22 at 08:10
  • 1
    [Here](https://stackoverflow.com/a/26800937/9841389) you can find a related answer. Furthermore, the first link in my above comment is broken and I can't edit any longer - correct link: https://en.wikipedia.org/wiki/Loopback – ismirsehregal Jul 26 '22 at 08:41
  • @ismirsehregal Great! First link dead, but could find it with the word that appears (Loopback) – LulY Jul 26 '22 at 08:54

1 Answers1

2

Just to leave a clear answer regarding your question:

Your app never was online.

Via 127.0.0.1 your browser is accessing the standard address for IPv4 loopback traffic on your localhost (your PC) - please see this.

runApp()'s default for the host parameter is:

host = getOption("shiny.host", "127.0.0.1")

On the other hand using runApp("0.0.0.0") as described here makes your app accessible from the LAN.

To share your shiny applications online you can e.g. publish them on shinyapps.io.

ismirsehregal
  • 30,045
  • 5
  • 31
  • 78