Use window.location.hostname for WebSocket connection

This commit is contained in:
Michael Camilleri 2023-01-20 11:04:46 +09:00
parent 151ea479f3
commit 28ddae7f3a
No known key found for this signature in database
GPG key ID: 7EB218A48DF8B572

View file

@ -36,7 +36,7 @@
(when-let [ws-port (.-SCITTLE_NREPL_WEBSOCKET_PORT js/window)]
(set! (.-ws_nrepl js/window)
(new js/WebSocket (ws-url "localhost" ws-port "_nrepl"))))
(new js/WebSocket (ws-url (.-hostname (.-location js/window)) ws-port "_nrepl"))))
(when-let [ws (nrepl-websocket)]
(prn :ws ws)