Use relative paths for websocket connection
This commit is contained in:
parent
10148897c8
commit
1eb7136d27
1 changed files with 5 additions and 3 deletions
|
@ -7,10 +7,12 @@
|
||||||
(:require-macros [cljs.core.async.macros :refer [go go-loop]]
|
(:require-macros [cljs.core.async.macros :refer [go go-loop]]
|
||||||
[grub.macros :refer [log logs]]))
|
[grub.macros :refer [log logs]]))
|
||||||
|
|
||||||
(def protocol (.-protocol (.-location js/document)))
|
(def location (.-location js/document))
|
||||||
|
(def protocol (.-protocol location))
|
||||||
(def ws-protocol (if (= protocol "http:") "ws://" "wss://"))
|
(def ws-protocol (if (= protocol "http:") "ws://" "wss://"))
|
||||||
(def host (.-host (.-location js/document)))
|
(def host (.-host location))
|
||||||
(def server-url (str ws-protocol host))
|
(def path (.-pathname location))
|
||||||
|
(def server-url (str ws-protocol host path))
|
||||||
(def reader (t/reader :json))
|
(def reader (t/reader :json))
|
||||||
(def writer (t/writer :json))
|
(def writer (t/writer :json))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue