Cannot connect remotely to shiny-server and get R app working properly

自闭症网瘾萝莉.ら 提交于 2021-02-11 00:37:53

问题


I HAVE FIXED THIS ISSUE. Please read answer below

I have installed shiny-server on Ubuntu 14.04.4 LTS with VirtualBox. After forwarding port 3838 in my router and setting a bridged network, then assigning a static IP to my virtual Ubuntu machine, I am being able to connect remotely, from a computer outside from my network and visualize the "hello" example app page, but only the HTML code is rendered.

Both R and markdown iframes are not working (connection is reset and they are grayed). On the other hand, I can perfectly browse the hello application from both, my host computer of from the guest machine itself.

The ports are open, I have checked it with a remote computer. My host computer runs on Windows 10 and I have also configured the firewall to allow TCP/UDP in/out traffic through port 3838.

I have got shiny server working on host 0.0.0.0 after running the command options(shiny.host="0.0.0.0") on RStudio but I still only can see the ui.R controls rendered and nothing from server.R that is still grayed.

Any idea of what can be causing this behaviour?


回答1:


In order to get shiny server running I have followed the official installation guide in www.rstudio.com/products/shiny/download-server/ as mentioned before.

There are a few details that allowed me to make it run from a remote host (a computer outside my network connecting via Internet).

  1. Installing packages always as root user so that they are shared among every user, ie, sudo su - \ -c "R -e \"install.packages('shiny', repos='....... (I cannot post more than 2 links yet :(
  2. Setting Shiny host to 0.0.0.0, but running on R studio this command: options(shiny.host="0.0.0.0")
  3. Opening ports 3838 TCP and UDP, both in and out on my host's firewall.
  4. Opening separately UDP and TCP ports in my router; not "TCP and UPD" but first TCP and then UDP.
  5. Opening the previous ports by the range 3838-3840, not just the 3838 one. This is not something I can give an explanation about since I was expecting that 3838 would be sufficient because shiny-server is running on host 0.0.0.0:3838; but in my case I needed to do it.
  6. In order to make it easier, I assigned a fixed IP to the computer running shiny server. click here to see network connection image

Here is a screenshot of my router configuration just in case someone finds it useful: Click here to see router port forwarding for shiny image



来源:https://stackoverflow.com/questions/36568434/cannot-connect-remotely-to-shiny-server-and-get-r-app-working-properly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!