Use window.location.hostname for WebSocket connection (#49)
* Use window.location.hostname for WebSocket connection * Update CHANGELOG
This commit is contained in:
parent
151ea479f3
commit
57536819c3
|
@ -2,6 +2,10 @@
|
|||
|
||||
[Scittle](https://github.com/babashka/scittle): execute Clojure(Script) directly from browser script tags via SCI!
|
||||
|
||||
## Unreleased
|
||||
|
||||
- Use `window.location.hostname` for WebSocket connection
|
||||
|
||||
## v0.5.14 (2023-01-05)
|
||||
|
||||
- Fix destructuring in `defmethod` (by upgrading SCI)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue