How to host a shiny app on windows? createTcpServer: address not available

Viewed 550

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?

2 Answers
  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.

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

Related