Whenever I change my shiny code and rerun it using the "reload app" button on the top right I get "connection refused". On the second attempt it goes through. Attaching a screen cast to show the problem. screencast
I tried saving the file first but still the same problem.
As per usual, some of your basic setup info will help (e.g. version of RStudio you're running). It's not that easy to see from the screencast, but it looks like on the first round of reloading there's no Listening on http://127.0.0.1.7023 showing up in the console, which would explain why there's no connection. As for the source of that, I'm not sure.
I will revert with more details shortly. Just upgraded my R on the ubuntu server from 3.4 to 3.5 and almost had a minor heart attack as everything stopped working for a while.