How should websocket fallback work? How to disable if it doesn't? (running behind proxy server)

I would like to run a shiny server behind a proxy which does not support websockets. I have tried disable_websockets and disable_protocols websocket in shiny-server.conf without seeing any change, which makes me less confident that my config file is actually being loaded. For more context, here's the Dockerfile I'm starting from.

I have a few small questions that I'm trying to clarify for myself, but I'm not sure which is most likely to move towards resolving the real issue.

  • I can cat /etc/shiny-server/shiny-server.conf, and it looks ok, but is there a way to confirm that these settings are actually being read, either on the client, or the server?
  • The shiny server docs say "if WebSockets are not supported ... then a fallback protocol will be used": When I access the shiny app directly, it works, but when I try to access it in a way which would not support websockets, it doesn't. (Either by using the proxy, or by using Firefox with network.websocket.max-connections set to 0.) Is this failure to fallback a bug, or is there something else wrong in each of these cases?
  • I can control the response code when it tries to access the websocket URL through the proxy... Could I do something here to get the right fallback behavior?

I can't answer precisely to your question but reading your Dockerfile, something strikes me.

CMD ["R", "-e", "shiny::runApp('.', 80, host='')"]

Here you are launching your shinyapps with R and not using shiny server. I think what you want is the shiny server to render your application. Place your app in the correct folder and start the shiny server not you app with R. Then, you'll see if the configuration are correct or not. Right now, I think they are not used because you don't use shiny server.

There are several example on projects that are using images with shiny-server that you could find. The rocker shiny image is one of them

I hope it is of any help.


Yes! Thank you: that was the obvious thing I was missing. Thank you again.

1 Like