Liking cljdoc? Tell your friends :D

ring.adapter.jetty9.websocket


proxy-ws-servletclj

(proxy-ws-servlet ws options)
source

reify-custom-ws-creatorclj

(reify-custom-ws-creator ws-creator-fn)
source

reify-default-ws-creatorclj

(reify-default-ws-creator ws-fns)
source

upgrade-websocketclj

(upgrade-websocket req res ws options)
(upgrade-websocket req
                   res
                   async-context
                   ws
                   {:as _options
                    :keys [ws-max-idle-time ws-max-text-message-size]
                    :or {ws-max-idle-time 500000
                         ws-max-text-message-size 65536}})
source

WebSocketPingcljprotocol

-ping!clj

(-ping! x ws)

How to encode bytes sent with a ping

How to encode bytes sent with a ping
source

WebSocketProtocolcljprotocol

close!clj

(close! this)
(close! this status-code reason)

connected?clj

(connected? this)

idle-timeout!clj

(idle-timeout! this ms)

ping!clj

(ping! this)
(ping! this msg)

remote-addrclj

(remote-addr this)

req-ofclj

(req-of this)

send!clj

(send! this msg)
(send! this msg callback)
source

WebSocketSendcljprotocol

-send!clj

(-send! x ws)
(-send! x ws callback)

How to encode content sent to the WebSocket clients

How to encode content sent to the WebSocket clients
source

ws-upgrade-request?clj

(ws-upgrade-request? {:keys [headers]})

Checks if a request is a websocket upgrade request.

It is a websocket upgrade request when it contains the following headers:

  • connection: upgrade
  • upgrade: websocket
Checks if a request is a websocket upgrade request.

It is a websocket upgrade request when it contains the following headers:
- connection: upgrade
- upgrade: websocket
sourceraw docstring

ws-upgrade-responseclj

(ws-upgrade-response ws-handler)

Returns a websocket upgrade response.

ws-handler must be a map of handler fns: {:on-connect #(create-fn %) ; ^Session ws-session :on-text #(text-fn % %2 %3 %4) ; ^Session ws-session message :on-bytes #(binary-fn % %2 %3 %4 %5 %6) ; ^Session ws-session payload offset len :on-close #(close-fn % %2 %3 %4) ; ^Session ws-session statusCode reason :on-error #(error-fn % %2 %3)} ; ^Session ws-session e or a custom creator function take upgrade request as parameter and returns a handler fns map, negotiated subprotocol and extensions (or error info).

The response contains HTTP status 101 (Switching Protocols) and the following headers:

  • connection: upgrade
  • upgrade: websocket
Returns a websocket upgrade response.

ws-handler must be a map of handler fns:
{:on-connect #(create-fn %)               ; ^Session ws-session
 :on-text   #(text-fn % %2 %3 %4)         ; ^Session ws-session message
 :on-bytes  #(binary-fn % %2 %3 %4 %5 %6) ; ^Session ws-session payload offset len
 :on-close  #(close-fn % %2 %3 %4)        ; ^Session ws-session statusCode reason
 :on-error  #(error-fn % %2 %3)}          ; ^Session ws-session e
or a custom creator function take upgrade request as parameter and returns a handler fns map,
negotiated subprotocol and extensions (or error info).

The response contains HTTP status 101 (Switching Protocols)
and the following headers:
- connection: upgrade
- upgrade: websocket
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close