Fork me on GitHub
#shadow-cljs
<
2022-09-23
>
Mario Trost19:09:35

Hi there 👋 We set up a reverse proxy for development and I added an entry to my hostfile to develop on a "real", non-localhost URL and proxy /api/ path to a deployed server. Unfortunately hot-reloading ist not working and I noticed that the websocket connection to localhost:9630 is not established. Is there a way to enable it?

Mario Trost19:09:26

(as an aside: while researching in the documentation I found the reverse-proxy ability of shadow itself 😄 still wondering if it's possible to have hot-reload with my initial setup)

thheller19:09:43

if you use a different server that doesn't use localhost then you might need to set https://shadow-cljs.github.io/docs/UsersGuide.html#proxy-support

thheller19:09:57

or :devtools {:use-document-host false}

thheller19:09:11

since it defaults to trying to connect to the host you loaded the page from

thheller19:09:31

the browser console should tell you whats up?

thheller19:09:57

the http server you use is not relevant to hot-reloading since it is all done over the websocket to 9630

thheller19:09:06

if that connect fails however there can be no hot-reload

thheller19:09:36

so a) you configure it where to connect to or b) have your proxy server also proxy the websocket connection

Mario Trost19:09:20

Thanks, :devtools {:use-document-host false} worked :thumbsup:

Mario Trost19:09:52

> the browser console should tell you whats up? It didn't really tell me that much: But that's my first Clojure(-script) work, so that doesn't mean much 😄

thheller19:09:24

well what I meant that it should tell you if it fails to connect, and what it was trying to connect to

Mario Trost20:09:51

That it didn't do :thinking_face: