ClojureScript repl over proxy

45 views
Skip to first unread message

Maksim Ryzhikov

unread,
Apr 21, 2021, 1:40:35 PM4/21/21
to Clojure
Hi,

I'm using a cloud development platform (Gitpod) and it automatically creates proxy from public URL to localhost, so you can develop a web application from cloud and see the result. I'm trying to run cljs REPL, but it fails to connect because it tries to connect to the REPL on `localhost:9090` which is not accessible from outside because I use public URL in a browser.

I have looked at the code and looks like HOST and PORT in browser hard-coded
https://github.com/clojure/clojurescript/blob/a4673b880756531ac5690f7b4721ad76c0810327/src/main/cljs/clojure/browser/repl.cljs#L31 but still maybe I have missed something, and it's possible to set up REPL for my use case. So would be glad to any response

Thanks

Lars Rune Nøstdal

unread,
Apr 22, 2021, 6:58:01 AM4/22/21
to Clojure
Hi,
I would stick with SSH tunnels for this tbh.. Because once you fix this particular issue right here, there's 2-3 similar issues showing up in 2-4 months; who knows. I use a tiny bash script in each project that deals with the particular ports needed.

mvh, L

Maksim Ryzhikov

unread,
Apr 23, 2021, 4:53:23 PM4/23/21
to Clojure
Thanks, but how SSH tunnel would help here? Currently, I see that ClojureScript hard coded localhost HOST and PORT in the JavaScript code which would send a request from the browser to establish REPL connection. Or you suggest setup forwarding localhost:9090 from local machine to the cloud? :) In this case it removes all advantages of cloud development because I should set up local environment before and in some cases I even could not do it at all
Reply all
Reply to author
Forward
0 new messages