Suave is an F# package with a small embedded web server and route combinators for async HTTP handling, giving .NET apps direct control without a large framework
Overview
Suave targets F# developers who need a lightweight in-process HTTP server and a composable way to wire routes and async work. It ships as a library you import into applications rather than as a standalone server product, and it draws on ideas from Happstack while aiming to stay embeddable.
The server side covers modern HTTP features including HTTP/2, server-sent events, WebSockets, TLS, multiple TCP bindings with SO_REUSEPORT on Linux and BSD, rate limiting, security headers, validation web parts, basic access authentication, and keep-alive. Routing can use an AOT-friendly router module alongside the classic WebPart style, where small functions over HTTP context combine with operators like >=> and choose.
Internally the stack uses non-blocking I/O built around Task, memory, and pipelines on recent .NET releases, with an emphasis on fewer allocations under load. Routes and responses can be modeled with F# types so many mistakes surface at compile time.
Typical uses described in the material include REST APIs with JSON and typed routes, small microservices, real-time apps over WebSockets, and static or hybrid sites with files and SPA fallbacks. It runs on modern .NET on Linux, macOS, and Windows, including as an executable or inside a container, and installs via NuGet packages such as Suave.
Key features
- Composable WebPart routing
- HTTP/2 and WebSockets support
- HTTPS and security headers
- Server-sent events
- Rate limiting
- Non-blocking async I/O
- Multiple TCP bindings
- Basic access authentication
Use cases
- REST APIs in F#
- Embedded HTTP servers
- Real-time WebSocket apps
- Static and hybrid web sites
- Small microservices