Skip to content

Commit

Permalink
Add ws-port option to change port that the websocket connects to
Browse files Browse the repository at this point in the history
Useful when the reload websocket is an upstream client of a reverse proxy (like nginx)
  • Loading branch information
Jacob Richardson committed Apr 6, 2016
1 parent 8d7bdb3 commit b11109d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/adzerk/boot_reload.clj
Expand Up @@ -23,11 +23,11 @@
(map tmp-path)
(remove static-files))))

(defn- start-server [pod {:keys [ip port ws-host secure?] :as opts}]
(defn- start-server [pod {:keys [ip port ws-host ws-port secure?] :as opts}]
(let [{:keys [ip port]} (pod/with-call-in pod (adzerk.boot-reload.server/start ~opts))
host (cond ws-host ws-host (= ip "0.0.0.0") "localhost" :else ip)
proto (if secure? "wss" "ws")]
(util/with-let [url (format "%s://%s:%d" proto host port)]
(util/with-let [url (format "%s://%s:%d" proto host (or ws-port port))]
(util/info "Starting reload server on %s\n" url))))

(defn- write-cljs! [f url ws-host on-jsload asset-host]
Expand Down Expand Up @@ -94,6 +94,7 @@
;; Websocket Server
i ip ADDR str "The IP address for the websocket server to listen on. (optional)"
p port PORT int "The port the websocket server listens on. (optional)"
_ ws-port PORT int "The port the websocket will connect to. (optional)"
w ws-host WSADDR str "The websocket host clients connect to. Defaults to current host. (optional)"
s secure bool "Flag to indicate whether the client should connect via wss. Defaults to false."
;; Other Configuration
Expand Down

0 comments on commit b11109d

Please sign in to comment.