Liking cljdoc? Tell your friends :D

server-lib.core


accept-requestclj

(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
sourceraw docstring

accept-web-socket-request-subprocessclj

(accept-web-socket-request-subprocess routing-fn
                                      client-socket
                                      header-map-with-body)

Work with established websocket connection

Work with established websocket connection
sourceraw docstring

add-default-response-headersclj

(add-default-response-headers response)

Add default headers in every response

Add default headers in every response
sourceraw docstring

array-blocking-queue-sizeclj

source

cached-filesclj

source

calculate-message-lengthclj

(calculate-message-length payload-byte input-stream)

Calculate message length from first bytes

https://tools.ietf.org/html/rfc6455#section-5.2

Calculate message length from first bytes

https://tools.ietf.org/html/rfc6455#section-5.2
sourceraw docstring

client-socketsclj

source

core-pool-sizeclj

source

cors-checkclj

(cors-check {origin :origin host :host} response default-response-headers)

Check is access allowed

Check is access allowed
sourceraw docstring

decode-messageclj

(decode-message encoded-bytes key-array)

Decode message sent through websocket

https://tools.ietf.org/html/rfc6455#section-5.2

Decode message sent through websocket

https://tools.ietf.org/html/rfc6455#section-5.2
sourceraw docstring

default-routing-fnclj

(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
sourceraw docstring

encode-messageclj

(encode-message message & [first-byte user-agent])

Encoding message to send it through websocket

https://tools.ietf.org/html/rfc6455#section-5.2

Encoding message to send it through websocket

https://tools.ietf.org/html/rfc6455#section-5.2
sourceraw docstring

executorclj

source

get-rangesclj

(get-ranges range-request)

Returns ranges from request header

Returns ranges from request header
sourceraw docstring

handler-fnclj

(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
sourceraw docstring

http-setclj

source

keep-alive-message-periodclj

source

keep-thread-alive-time-in-secondsclj

source

keystore-type-setclj

source

main-threadclj

source

maximum-pool-sizeclj

source

md5-checksum-fnclj

(md5-checksum-fn ary)

Generate checksum of read file

Generate checksum of read file
sourceraw docstring

open-server-socketclj

(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
sourceraw docstring

pack-responseclj

(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
sourceraw docstring

parse-bodyclj

(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
sourceraw docstring

port-aclj

source

positive-byte-valueclj

(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
sourceraw docstring

powclj

(pow value)

Square of value

Square of value
sourceraw docstring

prepend-zerosclj

(prepend-zeros byte-param)

Prepend zeros to binary representation of byte

Prepend zeros to binary representation of byte
sourceraw docstring

public-dir-aclj

source

read-certificateclj

(read-certificate keystore-file-path)

Read certificate if it exists

Read certificate if it exists
sourceraw docstring

read-fileclj

(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
sourceraw docstring

read-headerclj

(read-header header)

Read header of XMLHTTPRequest

Read header of XMLHTTPRequest
sourceraw docstring

read-till-fin-is-oneclj

(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)
sourceraw docstring

runningclj

source

server-socketclj

source

ssl-contex-setclj

source

start-serverclj

(start-server routing-fn
              &
              [default-response-headers port https-conf public-dir])

Starts listening on opened server socket

Starts listening on opened server socket
sourceraw docstring

stop-serverclj

(stop-server)

Stop server

Stop server
sourceraw docstring

utf-8clj

source

while-loopclj

(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
sourceraw docstring

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

× close