hellhound.http.websocket

Websocket module of HellHound is responsible for creating a websocket server on top of Immutant server and dispatch the event coming from clients to event-router and send back the result

accept-ws

(accept-ws {:keys [request], :as context})

clients

get-client-id

(get-client-id ws-session)

Returns an id for the given socket session

get-or-create-user-id

(get-or-create-user-id context)

interceptor-factory

(interceptor-factory)

new-client-connected!

(new-client-connected! send-ch)

This function is responsible to populate the client attom when a new client joined

send-and-close!

(send-and-close!)

send-message-to-all!

(send-message-to-all! message)

setup-ws-input

(setup-ws-input {:keys [uid input ws-stream hooks], :as context})

setup-ws-output

(setup-ws-output {:keys [uid output ws-stream], :as context})

ws

(ws {:keys [uid], :as context})

ws-on-binary

(ws-on-binary payload offset length)

Default on-text callback for the websocket server

ws-on-close

(ws-on-close channel {:keys [code reason]})

ws-on-error

(ws-on-error session t)

ws-on-text

(ws-on-text session msg)

Default on-text callback for the websocket server