                        (on-receive channel (fn [data]
                                              (if (string? data)
                                                (do
-                                                 (debug "server received data:" url data)
+                                                 (debug "server received string data:" url data)
                                                  (async/put! in
                                                              (with-meta
                                                                (read-string-safe @tag-table data)

                           (if (@channel-hub channel)
                             (do
                               (debug "server sending msg:" url (pr-str m))
                               (if (= (:topic m) :binary-fetched)
                                 (send! channel ^bytes (let [out (ByteArrayOutputStream.)]
                                                         (.write out (byte 0))
                                                         (.write out (:value m))
                                                         (.toByteArray out)))
                                 (let [baos (ByteArrayOutputStream. (* 100 1024 1024))
                                       writer (transit/writer baos :json)]
                                   (.write baos (byte-array 1 (byte 1)))
                                   (transit/write writer m)
                                   (send! channel (.toByteArray baos) #_(str " " (pr-str m))))))
                             (debug "dropping msg because of closed channel: " url (pr-str m)))
                           (recur (<! out))))
                       (on-close channel (fn [status]

                             (go-loop [m (<! out)]
                               (when m
                                 (debug "client sending msg to:" url m)
                                 (with-open [baos (ByteArrayOutputStream.)]
                                   (if (= (:topic m) :binary-fetched)
                                     (do
                                       (.write baos (byte 0))
                                       (.write baos (:value m)))
                                     (let [writer (transit/writer baos :json)]
                                       (.write baos (byte-array 1 (byte 1)))
                                       (transit/write writer m)))
                                   (cli/send ws :byte (.toByteArray baos)))
                                 (recur (<! out))))
                             (async/put! opener [in out])
                             (async/close! opener))
