0

I have a problem trying to share R Shiny app on local LAN using runApp(host = "0.0.0.0") function. Everything works fine on server host but it always crashes from client side: the screen became grey after about 1 sec when launching the app.

I've have investigated on this and it seem's that issue is due to timeout restrictions when the app is launched.

Does someone have an idea to overcome this problem ? Is there any possibility to adjust loadTimeout parameter on Shiny app ( I precise that this app is not hosted on Shiny server but only with an R Studio Desktop instance )

Thank's a lot for your help !

JeanBertin
  • 633
  • 1
  • 7
  • 23

2 Answers2

0

You might want to use the runUrl( "<the weblink>") command inside the client Rstudio session, here is a link. Looks like the client computer will need Rstudio installed as well. here is a similar Stackoverflow question

Daniel_j_iii
  • 3,041
  • 2
  • 11
  • 27
  • Thank's for your answer! Unfortunately I'm a looking for an option where the client doesn't need to have R and Rstudio installed. This option worked since last month in my organisation – JeanBertin Jun 16 '20 at 14:29
  • if it's only 1 user, you could get up RDP to the computer where shiny is running, or create a virtual machine and have them just log into the virtual machine that hosts the application? im interested in how you will host a shiny app within a network without R server, that will be cool to know how to do. are you making sure you specify the port? – Daniel_j_iii Jun 16 '20 at 16:02
  • Ok ! If you are interested, the way to deploy the shiny app without any R server is very easy: you just have to precise host = "0.0.0.0" and (for instance) port = 1010 in runApp function at the end of your lauch script . Then, given the ip adress of the host is for instance 10.112.47.89( you can tape ipconfig on the terminal to know yours), the shiny app would be reacheable from any client at 10.112.47.89:1010 ( R and Rstudio don't even need to be installed) . This method worked for me since last week: now it only works with very simple apps. – JeanBertin Jun 17 '20 at 07:42
  • [look here](https://shiny.rstudio.com/reference/shiny/latest/runApp.html) on the rstudio website it shows `host = getOption("shiny.host", "127.0.0.1")` as the proper syntax. I am wondering if either a windows update from the sysadmins broke your app or an update within R/shiny version changed syntax on you – Daniel_j_iii Jun 17 '20 at 15:33
0

this worked for me inside my home network.

library(shiny)


# Running a Shiny app object
app <- shinyApp(
    ui = bootstrapPage(
        numericInput('n', 'Number of obs', 100),
        plotOutput('plot')
    ),
    server = function(input, output) {
        output$plot <- renderPlot({ hist(runif(input$n)) })
    }
)
runApp(app, host = getOption("shiny.host", "192.168.1.25"))

and then on another computer I opened a web browser to 192.168.1.25:6938 which the specific port was displayed inside Rstudio with Shiny

Daniel_j_iii
  • 3,041
  • 2
  • 11
  • 27