parent
c449f55a9b
commit
d215e5878b
2 changed files with 13 additions and 1 deletions
|
|
@ -42,6 +42,16 @@ you should be able evaluate expressions in `playground.cljs`. See a demo
|
|||
Note that the nREPL server connection stays alive even after the browser window
|
||||
refreshes.
|
||||
|
||||
### Custom host address
|
||||
|
||||
By default, the browser will connect to a websocket on the same host as it is loaded
|
||||
from, using `window.location.hostname`. If you need something else you can specify
|
||||
that setting the window variable `SCITTLE_NREPL_WEBSOCKET_HOST` like so:
|
||||
|
||||
``` html
|
||||
<script>var SCITTLE_NREPL_WEBSOCKET_HOST = 'localhost';</script>
|
||||
```
|
||||
|
||||
### CIDER
|
||||
|
||||
Choose `cider-connect-cljs`, select port `1339`, followed by the `nbb` REPL
|
||||
|
|
|
|||
|
|
@ -8,7 +8,9 @@
|
|||
|
||||
(when-let [ws-port (.-SCITTLE_NREPL_WEBSOCKET_PORT js/window)]
|
||||
(set! (.-ws_nrepl js/window)
|
||||
(new js/WebSocket (ws-url (.-hostname (.-location js/window)) ws-port "_nrepl"))))
|
||||
(new js/WebSocket (ws-url (or (.-SCITTLE_NREPL_WEBSOCKET_HOST js/window)
|
||||
(.-hostname (.-location js/window)))
|
||||
ws-port "_nrepl"))))
|
||||
|
||||
(when-let [ws (nrepl-server/nrepl-websocket)]
|
||||
(set! (.-onmessage ws)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue