                                      (glog/error logger e))))))
           (.addEventListener goog.net.WebSocket.EventType.OPENED
                              (fn [e]
+                               (connection-established! url)
                                (swap! state assoc :connection {:websocket websocket})
                                (hook-repl-printing-output! {:websocket websocket})))
           (.open url))))))

                 :args (mapv #(if (string? %) % (gjson/serialize %)) args)}))
  (setup-printing!))

(defn get-websocket-class []
  (or
   (gobj/get goog.global "WebSocket")

             (let [typ (gobj/get msg "connection-type")]
               (glog/info logger (str "Connected: " typ))
               (msg-fn msg)
               (connection-established! url)
               ;; after connecting setup printing redirects
               (swap! state assoc :connection {:http-url surl})
               (hook-repl-printing-output! {:http-url surl})
