3

i'm trying to host my shinyapp in windows with user1693885's answer here and Nicola's aswer here,

app=shinyApp(ui = ui, server = server)
#x <- system("ipconfig", intern=TRUE) # LOCAL ACCESS APPROACH WORKS PERFECLY
#z <- x[grep("IPv4", x)]              #LOCAL ACCESS APPROACH WORKS PERFECLY
#ip <- gsub(".*? ([[:digit:]])", "\\1", z)#LOCAL ACCESS APPROACH WORKS PERFECLY

ip="MY.IP.XXX.XXX.ETC"     # ATTEMPT WITH PUBLIC IP

print(paste0("the Shiny Web application runs on: http://", ip[1], ":1234/"))

runApp(app, launch.browser=FALSE, port = 1234, host = ip[1])

the app works on other devices that are connected to the same network perfectly with the local acess approach but when i try to use my public ip for remote access the website dont open, and when i try to use my public in the host argument in runApp() function gives a error :createTcpServer: address not available i already open the 1234 port in my firewall, what can be causing this?

KmnsE2
  • 424
  • 2
  • 9
  • "address not available" means that there is no network interface with the configured ip address you try to listen on. You need to listen on your local lan ip. your router must forward connections to that ip/port. Then you can connect via a external client to your public ip/port – Marc Oct 17 '20 at 20:17
  • ip[1]? do you want to run app on "Y" address? – vitalyster Oct 18 '20 at 20:43
  • ip and ip[1] give the same result. What do you mean by "Y" address? – KmnsE2 Oct 18 '20 at 21:27
  • I already forward the port 1234 in my router and the error persists – KmnsE2 Oct 18 '20 at 21:33

2 Answers2

2
  1. Did you also forward the port on your router?
  2. (in case you did 1.) did you try to access the app via the public IP from a device that is not in your local network? It could be possible that your router does not support NAT Loopback.

Another approach would be to just host it in a docker container.

Tschösi
  • 491
  • 3
  • 13
  • 1- i did it. 2- yes, when i access with my local network by another device the app open but when i try to access with other network the app dont open. – KmnsE2 Oct 15 '20 at 14:54
1

I had the same issue (in fact, I'm running shiny on an EC2 windows instance on AWS). I just put

host='0.0.0.0' 

and that seems to accept traffic from the local segment as well as from the public ip