Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make browser-connected-repl-js compatible with connections from any host... #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/clj/cemerick/austin/repls.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(ns cemerick.austin.repls
(:require [cemerick.austin :refer (exec-env)]
(:require [cemerick.austin :refer (exec-env get-browser-repl-port)]
[clojure.tools.nrepl.middleware.interruptible-eval :as nrepl-eval]
[cemerick.piggieback :as pb]
cljs.repl))
Expand Down Expand Up @@ -36,9 +36,11 @@ When you want your app to connect to a different REPL environment, just
a JavaScript string that will connect the browser runtime to that REPL environment
on load. See `browser-repl-env` docs for more."
[]
(when-let [repl-url (:repl-url @browser-repl-env)]
(format ";goog.require('clojure.browser.repl');clojure.browser.repl.connect.call(null, '%s');"
repl-url)))
(when-let [session-id (:session-id @browser-repl-env)]
(format ";goog.require('clojure.browser.repl');clojure.browser.repl.connect.call(null, window.location.protocol+'//'+window.location.hostname+':%s/%s/repl');"
(get-browser-repl-port)
session-id
)))

(defn cljs-repl
"Same as `cljs.repl/repl`, except will use the appropriate REPL entry point
Expand Down