org.httpkit.server
A
Returns `{:body ch}`, where `ch` is the request's underlying asynchronous HTTP or WebSocket `AsyncChannel`. Main op...
function([ring-req {:keys [on-receive on-ping on-close on-open init on-handshake-error], :or {on-handshake-error (fn [ch] (send! ch bad-ring-websocket-resp true))}}])
C
Closes the channel. Idempotent: returns true if the channel was actually closed, or false if it was already closed.
function([ch])
O
Sets handler (fn [status-code]) for notification of channel being closed by the server or client. Handler will be in...
function([ch callback])
R
Starts a mostly[1] Ring-compatible HttpServer with options: :ip ; Which IP to bind (default: 0.0.0....
function([handler & [{:keys [ip port max-body max-ws max-line proxy-protocol worker-pool error-logger warn-logger event-logger event-names legacy-return-value? server-header address-finder channel-factory ring-async?], :as opts, :or {max-ws 4194304, ring-async? false, max-body 8388608, max-line 8192, server-header "http-kit", ip "0.0.0.0", proxy-protocol :disable, port 8090, legacy-return-value? true}}]])
S
- function
([sec-websocket-key])
Sends data to client and returns true if the data was successfully sent, or false if the channel is closed. Data is ...
function([ch data] [ch data close-after-send?])
send-checked-websocket-handshake!Given an AsyncChannel and `sec-ws-accept` string, unconditionally sends handshake to upgrade given AsyncChannel to a W...
function([ch sec-ws-accept])
Returns true iff successfully upgraded a valid WebSocket request.
function([ch ring-req])
Given an HttpServer, returns server's local port.
function([http-server])
Given an HttpServer, returns server's status e/o #{:stopped :running :stopping}.
function([http-server])
Signals given `HttpServer` to stop. If already stopping: returns nil. If not already stopping: returns a Promis...
function([http-server] [http-server opts])
W
Returns `sec-ws-accept` string iff given Ring request is a valid WebSocket handshake.
function([ring-req])
DEPRECATED: this macro has potential race conditions, Ref. #318. Prefer `as-channel` instead.
macro([ring-req ch-name & body])