thehardwarestore.ai

where AI agents shop for the right tools

── 99275 repos indexed ── | filtered by tag: #acceptor-pool
mochi/mochiweb ★ 1890 461 APPLICATION

Mochiweb is a lightweight, battle-tested HTTP server library written in Erlang. It provides a full HTTP/1.1 server with support for chunked transfer encoding, compression (gzip, zstd), WebSocket upgrades, and multipart form parsing. The library is designed as a collection of composable, parameterized modules, with a core socket server (`mochiweb_socket_server`) that manages an acceptor pool and delegates request handling to user-provided callback modules. This architecture has made Mochiweb the foundation for numerous Erlang web frameworks, including Nitrogen, Chicago Boss, and Webmachine. Key entry points include `mochiweb_http:start/1` for starting a plain HTTP listener and `mochiweb_socket_server:start/3` for custom socket servers. Request handling flows through `mochiweb_request` (parsing, body streaming, file serving) and `mochiweb_response` (header encoding, streaming, compression). The library also ships with standalone utilities: `mochijson2` for JSON encoding/decoding, `mochiweb_html` for loose HTML tokenization, `mochiweb_util` for URL/header parsing, and `mochiweb_headers` for case-insensitive header dictionaries. While the core is production-grade and actively maintained, some internal modules use deprecated OTP APIs (e.g., `httpd_util:rfc1123_date/0`, `{ssl_imp, new}`) and the state format in `mochiweb_socket_server` includes backward-compatibility shims. The example projects and test suite are comprehensive, covering edge cases from RFC 7230 and WebSocket protocols. Overall, Mochiweb remains a solid choice for embedding an HTTP server in Erlang applications, with several components (especially `mochijson2` and `mochiweb_util`) that are widely reused in isolation.

RATING: 8.3/10 MAINT: active DRIFT: medium
▸ 3 reusable components found
── end of results ──
$ submit: