(accept-request routing-fn client-socket default-response-headers reject)
Reads input stream from client socket converts request string into clojure map and passes it to routing-fn function for other processing
Reads input stream from client socket converts request string into clojure map and passes it to routing-fn function for other processing
(accept-web-socket-request-subprocess routing-fn
client-socket
header-map-with-body)
Work with established websocket connection
Work with established websocket connection
(add-default-response-headers response)
Add default headers in every response
Add default headers in every response
(calculate-message-length payload-byte input-stream)
Calculate message length from first bytes
Calculate message length from first bytes https://tools.ietf.org/html/rfc6455#section-5.2
(cors-check {origin :origin host :host} response default-response-headers)
Check is access allowed
Check is access allowed
(decode-message encoded-bytes key-array)
Decode message sent through websocket
Decode message sent through websocket https://tools.ietf.org/html/rfc6455#section-5.2
(default-routing-fn request response)
Default routing function for reading files recognized by request uri
Default routing function for reading files recognized by request uri
(encode-message message & [first-byte user-agent])
Encoding message to send it through websocket
Encoding message to send it through websocket https://tools.ietf.org/html/rfc6455#section-5.2
(get-ranges range-request)
Returns ranges from request header
Returns ranges from request header
(handler-fn routing-fn request default-response-headers reject)
Handle request by passing request to routing-fn function routing-fn - is function implemented in applications server side request - is XMLHTTPRequest string converted into clojure map default-response-headers - map of default response headers defined when starting server
Handle request by passing request to routing-fn function routing-fn - is function implemented in applications server side request - is XMLHTTPRequest string converted into clojure map default-response-headers - map of default response headers defined when starting server
(is-bytes? x)
Return true if x is a byte array
Return true if x is a byte array
(md5-checksum-fn ary)
Generate checksum of read file
Generate checksum of read file
(open-server-socket port
&
[{keystore-file-path :keystore-file-path
keystore-type :keystore-type
keystore-password :keystore-password
ssl-context :ssl-context}])
Open server socket on local machine
Open server socket on local machine
(pack-response {request-protocol :request-protocol}
{status :status headers :headers body :body})
Format response as string out of clojure's response-map
Format response as string out of clojure's response-map
(parse-body request-body content-type)
Read entity-body from request, convert from string to clojure data
Read entity-body from request, convert from string to clojure data
(positive-byte-value byte-value)
Transforms negative byte value to positive, and positive stays the same
Transforms negative byte value to positive, and positive stays the same
(prepend-zeros byte-param)
Prepend zeros to binary representation of byte
Prepend zeros to binary representation of byte
(read-certificate keystore-file-path)
Read certificate if it exists
Read certificate if it exists
(read-file file-path extension request & [is-absolute-path])
Read file and recognize it's mime type
Read file and recognize it's mime type
(read-header header)
Read header of XMLHTTPRequest
Read header of XMLHTTPRequest
(read-till-fin-is-one input-stream)
Read from input stream all messages till FIN bit has value 1 (one)
Read from input stream all messages till FIN bit has value 1 (one)
(start-server routing-fn
&
[default-response-headers port https-conf public-dir])
Starts listening on opened server socket
Starts listening on opened server socket
(while-loop routing-fn & [default-response-headers])
While loop of accepting and responding on clients requests
While loop of accepting and responding on clients requests
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close