Use ws or wss based on location protocol
This commit is contained in:
parent
90d7ee91ca
commit
ab67f02172
1 changed files with 4 additions and 1 deletions
|
@ -7,7 +7,10 @@
|
|||
(:require-macros [cljs.core.async.macros :refer [go go-loop]]
|
||||
[grub.macros :refer [log logs]]))
|
||||
|
||||
(def server-url (str "ws://" (.-host (.-location js/document))))
|
||||
(def protocol (.-protocol (.-location js/document)))
|
||||
(def ws-protocol (if (= protocol "http:") "ws://" "wss://"))
|
||||
(def host (.-host (.-location js/document)))
|
||||
(def server-url (str ws-protocol host))
|
||||
(def reader (t/reader :json))
|
||||
(def writer (t/writer :json))
|
||||
|
||||
|
|
Loading…
Reference in a new issue