-
Notifications
You must be signed in to change notification settings - Fork 45
/
client.clj
22 lines (21 loc) · 888 Bytes
/
client.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(ns puppetlabs.experimental.websockets.client)
(defprotocol WebSocketProtocol
"Functions to manage the lifecycle of a websocket session"
(idle-timeout! [this ms]
"Set the idle timeout for the session, in milliseconds")
(connected? [this]
"Returns a boolean indicating if the session is currently connected")
(send! [this msg]
"Send a message to the websocket client")
(close! [this] [this code reason]
"Close the websocket session.")
(disconnect [this]
"Disconnect the websocket connection")
(remote-addr [this]
"Find the remote address of a websocket client")
(ssl? [this]
"Returns a boolean indicating if the session was established by wss://")
(peer-certs [this]
"Returns an array of X509Certs presented by the ssl peer, if any")
(request-path [this]
"Returns the URI path used in the websocket upgrade request to the server"))