$ account sunng87
This repository provides a Ring adapter for Jetty web servers, enabling Clojure/Ring applications to run on Jetty 11 and 12 with support for modern web protocols. Despite its 'jetty9' name, it tracks recent Jetty releases and adds features like HTTP/2, HTTP/3, and WebSocket support that aren't in the official Ring Jetty adapter. The architecture centers around a core adapter that creates and configures Jetty Server instances, with separate implementations for synchronous and asynchronous Ring handlers. It cleanly separates concerns: connection handling (HTTP/HTTPS/HTTP/2/HTTP/3), request/response translation between Jetty and Ring models, and protocol-specific upgrades (WebSocket). The adapter supports virtual threads, SSL/TLS configuration, and serves as a drop-in replacement for the official ring-jetty-adapter while offering more recent Jetty versions and additional features. Notable for its quality implementation are the WebSocket bridge that properly translates between Jetty's WebSocketListener and Ring's WebSocket protocols, and the asynchronous handler implementation that correctly manages the race condition between handler completion and timeout using atomic state and Jetty's scheduling facilities. The optional HTTP/2 and HTTP/3 modules demonstrate good practices for extending the core adapter with dynamically loaded dependencies.