Adapter for the Jetty 10 server, with websocket support. Derived from ring.adapter.jetty
Adapter for the Jetty 10 server, with websocket support. Derived from ring.adapter.jetty
(proxy-async-handler handler options)
Returns a Jetty Handler implementation for the given Ring async handler.
Returns a Jetty Handler implementation for the given Ring **async** handler.
(proxy-handler handler options)
Returns a Jetty Handler implementation for the given Ring handler.
Returns a Jetty Handler implementation for the given Ring handler.
(run-jetty
handler
{:as options
:keys [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:
:configurator - a function called with the Jetty Server instance (allows for configuration beyond the supported options listed below)
: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?)
:ssl-hot-reload? - watch the keystore file for changes (defaults to true when ssl?)
:lifecycle-start - a no-arg fn to call when the server starts (per the server's LifeCycle.doStart
)
:lifecycle-end - a no-arg fn to call when the server stops (per the server's LifeCycle.doStop
)
:ssl-context - an optional SSLContext to use for SSL connections
: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
:exclude-ciphers - when :ssl? is true, additionally exclude these
cipher suites
:exclude-protocols - when :ssl? is true, additionally exclude these
protocols
:replace-exclude-ciphers? - when true, :exclude-ciphers will replace rather
than add to the cipher exclusion list (defaults
to false)
:replace-exclude-protocols? - when true, :exclude-protocols will replace
rather than add to the protocols exclusion list
(defaults to false)
:thread-pool - the thread pool for Jetty workload, accepts an instance of org.eclipse.jetty.util.thread.ThreadPool
: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
:virtual-threads? - to enable virtual threads for thread pool, ignored if :thread-pool
provided
:max-idle-time - the maximum idle time in milliseconds for a connection (default 200000)
:output-buffer-size - size of http response buffer, default to 32768
:output-aggregation-size - size of http aggregation size, defualt to 8192
:ws-configurator - a function called with the websocket container instance (allows for configuration beyond the supported options listed below)
:ws-max-idle-time - the maximum idle time in milliseconds for a websocket connection (default 30000, inherited from jetty defaults)
:ws-max-frame-size - the maximum message size in bytes for a websocket connection (default 65536, inherited from jetty defaults)
:ws-max-binary-message-size - the maximum binary message size in bytes for a websocket connection (default 65536, inherited from jetty defaults)
:ws-max-text-message-size - the maximum text message size in bytes for a websocket connection (default 65536, inherited from jetty defaults)
:client-auth - SSL client certificate authenticate, may be set to :need, :want or :none (defaults to :none)
:h2? - enable http2 protocol on secure socket port
:h2c? - enable http2 clear text on plain socket port
:h2-options - map with options specific for http2 (all setters from https://www.eclipse.org/jetty/javadoc/jetty-11/org/eclipse/jetty/http2/server/AbstractHTTP2ServerConnectionFactory.html,
kebab cased without "set", e.g. setMaxConcurrentStreams -> max-concurrent-streams)
: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
:sni-required? - require sni for secure connection, default to false
:sni-host-check? - enable host check for secure connection, default to true
:http3? - enable http3 protocol, make sure you have info.sunng/ring-jetty9-adapter-http3
package on classpath
:http3-pem-work-directory - required when http3 enabled, specify a directory as http3 pem work dir
:http3-options - map with options specific for http3
(all setters from https://www.eclipse.org/jetty/javadoc/jetty-11/org/eclipse/jetty/http3/HTTP3Configuration.html
and https://www.eclipse.org/jetty/javadoc/jetty-11/org/eclipse/jetty/quic/common/QuicConfiguration.html,
kebab cased without "set", e.g. setStreamIdleTimeout -> stream-idle-timeout)
Start a Jetty webserver to serve the given handler according to the supplied options: :configurator - a function called with the Jetty Server instance (allows for configuration beyond the supported options listed below) :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?) :ssl-hot-reload? - watch the keystore file for changes (defaults to true when ssl?) :lifecycle-start - a no-arg fn to call when the server starts (per the server's `LifeCycle.doStart`) :lifecycle-end - a no-arg fn to call when the server stops (per the server's `LifeCycle.doStop`) :ssl-context - an optional SSLContext to use for SSL connections :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 :exclude-ciphers - when :ssl? is true, additionally exclude these cipher suites :exclude-protocols - when :ssl? is true, additionally exclude these protocols :replace-exclude-ciphers? - when true, :exclude-ciphers will replace rather than add to the cipher exclusion list (defaults to false) :replace-exclude-protocols? - when true, :exclude-protocols will replace rather than add to the protocols exclusion list (defaults to false) :thread-pool - the thread pool for Jetty workload, accepts an instance of `org.eclipse.jetty.util.thread.ThreadPool` :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 :virtual-threads? - to enable virtual threads for thread pool, ignored if `:thread-pool` provided :max-idle-time - the maximum idle time in milliseconds for a connection (default 200000) :output-buffer-size - size of http response buffer, default to 32768 :output-aggregation-size - size of http aggregation size, defualt to 8192 :ws-configurator - a function called with the websocket container instance (allows for configuration beyond the supported options listed below) :ws-max-idle-time - the maximum idle time in milliseconds for a websocket connection (default 30000, inherited from jetty defaults) :ws-max-frame-size - the maximum message size in bytes for a websocket connection (default 65536, inherited from jetty defaults) :ws-max-binary-message-size - the maximum binary message size in bytes for a websocket connection (default 65536, inherited from jetty defaults) :ws-max-text-message-size - the maximum text message size in bytes for a websocket connection (default 65536, inherited from jetty defaults) :client-auth - SSL client certificate authenticate, may be set to :need, :want or :none (defaults to :none) :h2? - enable http2 protocol on secure socket port :h2c? - enable http2 clear text on plain socket port :h2-options - map with options specific for http2 (all setters from https://www.eclipse.org/jetty/javadoc/jetty-11/org/eclipse/jetty/http2/server/AbstractHTTP2ServerConnectionFactory.html, kebab cased without "set", e.g. setMaxConcurrentStreams -> max-concurrent-streams) :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 :sni-required? - require sni for secure connection, default to false :sni-host-check? - enable host check for secure connection, default to true :http3? - enable http3 protocol, make sure you have `info.sunng/ring-jetty9-adapter-http3` package on classpath :http3-pem-work-directory - required when http3 enabled, specify a directory as http3 pem work dir :http3-options - map with options specific for http3 (all setters from https://www.eclipse.org/jetty/javadoc/jetty-11/org/eclipse/jetty/http3/HTTP3Configuration.html and https://www.eclipse.org/jetty/javadoc/jetty-11/org/eclipse/jetty/quic/common/QuicConfiguration.html, kebab cased without "set", e.g. setStreamIdleTimeout -> stream-idle-timeout)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close