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
(normalize-response response)
Normalize response for ring spec
Normalize response for ring spec
(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.
(proxy-handler handler)
Returns an Jetty Handler implementation for the given Ring handler.
Returns an Jetty Handler implementation for the given Ring handler.
(run-jetty handler
{:as options
:keys [max-threads websockets configurator join? async?
allow-null-path-info]
:or {max-threads 50 allow-null-path-info false join? true}})
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 :max-threads - the maximum number of threads to use (default 50) :min-threads - the minimum number of threads to use (default 8) :threadpool-idle-timeout - the maximum idle time in milliseconds for a thread (default 60000) :job-queue - the job queue to be used by the Jetty threadpool (default is unbounded) :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)
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 :max-threads - the maximum number of threads to use (default 50) :min-threads - the minimum number of threads to use (default 8) :threadpool-idle-timeout - the maximum idle time in milliseconds for a thread (default 60000) :job-queue - the job queue to be used by the Jetty threadpool (default is unbounded) :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)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close