Liking cljdoc? Tell your friends :D

ring.adapter.jetty9

Adapter for the Jetty 9 server, with websocket support. Derived from ring.adapter.jetty

Adapter for the Jetty 9 server, with websocket support.
Derived from ring.adapter.jetty
raw docstring

close!clj

source

connected?clj

source

idle-timeout!clj

source

normalize-responseclj

(normalize-response response)

Normalize response for ring spec

Normalize response for ring spec
sourceraw docstring

proxy-async-handlerclj

(proxy-async-handler handler)

Returns an Jetty Handler implementation for the given Ring async handler.

Returns an Jetty Handler implementation for the given Ring **async** handler.
sourceraw docstring

proxy-handlerclj

(proxy-handler handler)

Returns an Jetty Handler implementation for the given Ring handler.

Returns an Jetty Handler implementation for the given Ring handler.
sourceraw docstring

remote-addrclj

source

req-ofclj

source

run-jettyclj

(run-jetty
  handler
  {:as options
   :keys [max-threads websockets configurator join? async? allow-null-path-info
          wrap-jetty-handler]
   :or {allow-null-path-info false join? true wrap-jetty-handler identity}})

Start a Jetty webserver to serve the given handler according to the supplied options:

:http? - allow connections over HTTP :port - the port to listen on (defaults to 80) :host - the hostname to listen on :async? - using Ring 1.6 async handler? :join? - blocks the thread until server ends (defaults to true) :daemon? - use daemon threads (defaults to false) :ssl? - allow connections over HTTPS :ssl-port - the SSL port to listen on (defaults to 443, implies :ssl?) :keystore - the keystore to use for SSL connections :keystore-type - the format of keystore :key-password - the password to the keystore :key-manager-password - the password for key manager :truststore - a truststore to use for SSL connections :truststore-type - the format of trust store :trust-password - the password to the truststore :ssl-protocols - the ssl protocols to use, default to ["TLSv1.3" "TLSv1.2"] :ssl-provider - the ssl provider, default to "Conscrypt" :thread-pool - the thread pool for Jetty workload :max-threads - the maximum number of threads to use (default 50), ignored if :thread-pool provided :min-threads - the minimum number of threads to use (default 8), ignored if :thread-pool provided :threadpool-idle-timeout - the maximum idle time in milliseconds for a thread (default 60000), ignored if :thread-pool provided :job-queue - the job queue to be used by the Jetty threadpool (default is unbounded), ignored if :thread-pool provided :max-idle-time - the maximum idle time in milliseconds for a connection (default 200000) :ws-max-idle-time - the maximum idle time in milliseconds for a websocket connection (default 500000) :client-auth - SSL client certificate authenticate, may be set to :need, :want or :none (defaults to :none) :websockets - a map from context path to a map of handler fns: {"/context" {: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 (or error info) :h2? - enable http2 protocol on secure socket port :h2c? - enable http2 clear text on plain socket port :proxy? - enable the proxy protocol on plain socket port (see http://www.eclipse.org/jetty/documentation/9.4.x/configuring-connectors.html#_proxy_protocol) :wrap-jetty-handler - a wrapper fn that wraps default jetty handler into another, default to identity, not that it's not a ring middleware

Start a Jetty webserver to serve the given handler according to the
supplied options:

:http? - allow connections over HTTP
:port - the port to listen on (defaults to 80)
:host - the hostname to listen on
:async? - using Ring 1.6 async handler?
:join? - blocks the thread until server ends (defaults to true)
:daemon? - use daemon threads (defaults to false)
:ssl? - allow connections over HTTPS
:ssl-port - the SSL port to listen on (defaults to 443, implies :ssl?)
:keystore - the keystore to use for SSL connections
:keystore-type - the format of keystore
:key-password - the password to the keystore
:key-manager-password - the password for key manager
:truststore - a truststore to use for SSL connections
:truststore-type - the format of trust store
:trust-password - the password to the truststore
:ssl-protocols - the ssl protocols to use, default to ["TLSv1.3" "TLSv1.2"]
:ssl-provider - the ssl provider, default to "Conscrypt"
:thread-pool - the thread pool for Jetty workload
:max-threads - the maximum number of threads to use (default 50), ignored if `:thread-pool` provided
:min-threads - the minimum number of threads to use (default 8), ignored if `:thread-pool` provided
:threadpool-idle-timeout - the maximum idle time in milliseconds for a thread (default 60000), ignored if `:thread-pool` provided
:job-queue - the job queue to be used by the Jetty threadpool (default is unbounded), ignored if `:thread-pool` provided
:max-idle-time  - the maximum idle time in milliseconds for a connection (default 200000)
:ws-max-idle-time  - the maximum idle time in milliseconds for a websocket connection (default 500000)
:client-auth - SSL client certificate authenticate, may be set to :need, :want or :none (defaults to :none)
:websockets - a map from context path to a map of handler fns:
 {"/context" {: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 (or error info)
:h2? - enable http2 protocol on secure socket port
:h2c? - enable http2 clear text on plain socket port
:proxy? - enable the proxy protocol on plain socket port (see http://www.eclipse.org/jetty/documentation/9.4.x/configuring-connectors.html#_proxy_protocol)
:wrap-jetty-handler - a wrapper fn that wraps default jetty handler into another, default to `identity`, not that it's not a ring middleware
sourceraw docstring

send!clj

source

stop-serverclj

(stop-server s)
source

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

× close