   [client message]
   (log/debug "no handler for " message))
 
-(defn- dispatch-message
-  [handlers client message]
+(defn dispatch-message
+  [client message]
   (let [message-type (:message_type message)
-        handers (:handlers client)
+        handlers (:handlers client)
         handler (or (get handlers message-type)
                     (get handlers :default)
                     fallback-handler)]

                                     (log/debug "websocket closed" code message))
                         :on-receive (fn [text]
                                       (log/debug "text message")
                                       (dispatch-message handlers @client (message/decode (message/string->bytes text))))
                         :on-binary (fn [buffer offset count]
                                      (log/debug "bytes message" offset count)
                                      (log/debug "got " (message/decode buffer))
                                      (dispatch-message handlers @client (message/decode buffer))))]
    (deliver client (assoc params :conn conn :websocket websocket))
    @client))

(s/defn ^:always-validate close :- s/Bool

  "schema for a client"
  (merge ConnectParams
         {:conn Object
          :websocket Object
          :handlers Handlers}))

;; private helpers for the ssl/websockets setup

