httpserver.h is a single-header C library for building high-performance, non-blocking, event-driven HTTP servers. It uses epoll on Linux and kqueue on BSD/macOS for I/O multiplexing, and includes a Ragel-generated HTTP parser that handles chunked transfer encoding, content-length bodies, streaming, and keep-alive connections. The library exposes a clean callback-based API: initialize a server with a port and request handler, then call listen to start the event loop. It also supports a poll mode for integration into existing event loops (e.g., game engines). The codebase is well-structured internally, split into separate compilation units that are concatenated into a single header at build time via M4. It includes comprehensive unit tests (using munit), functional tests (shell-driven), fuzz testing, and CI. Production-grade features include memory usage limits, request timeouts, connection management, and chunked response support. The architecture demonstrates strong C craftsmanship with clear separation of I/O, parsing, response formatting, and connection management.
This is a Go library for console and terminal handling, part of the containerd project. It provides a cross-platform `Console` interface with methods for setting raw mode, resizing, disabling echo, and querying window size. The library supports Linux, macOS, FreeBSD, NetBSD, OpenBSD, Windows, and z/OS via build tags. On Linux, it includes an `Epoller` that uses edge-triggered epoll for efficient non-blocking I/O, handling EAGAIN/EIO errors gracefully. It can create PTY pairs (`NewPty`) and obtain the current process console (`Current`). The only external dependency is `golang.org/x/sys`. The code is idiomatic, well-tested, and follows Go best practices, though the dependency version and CI Go version are outdated.