GenHTTP Webserver
September 23, 2026 ยท View on GitHub
GenHTTP is a lightweight, modular web server written in pure C# with a strong focus on developer experience. The main purpose of this project is to quickly create web services written in .NET 10 / 11, allowing developers to concentrate on the functionality rather than on messing around with configuration files or complex concepts.
Getting Started
To host a GenHTTP server instance in an existing or new .NET project, add a nuget reference to GenHTTP.Full to your
project and spin off a new host:
using GenHTTP.Engine.Internal;
using GenHTTP.Modules.ApiBrowsing;
using GenHTTP.Modules.Functional;
using GenHTTP.Modules.Layouting;
using GenHTTP.Modules.OpenApi;
using GenHTTP.Modules.Practices;
// use a handler of your choice (see the samples below)
var api = Inline.Create()
.Get((int a, int b) => a + b);
var app = Layout.Create()
.Add(api)
.AddOpenApi()
.AddScalar();
var host = await Host.Create()
.Handler(app)
.Defaults()
.StartAsync(); // or .RunAsync() to block until the (console) application is shut down
Running this snippet will provide the following endpoints:
| Endpoint | Description |
|---|---|
| http://localhost:8080/?a=1&b=2 | Serves the API, answering requests by calculating the sum of two query arguments. |
| http://localhost:8080/openapi.json | Serves the automatically generated Open API specification of the API. |
| http://localhost:8080/scalar/ | Servers a graphical viewer of the API, using Scalar. |
Samples
The playground project provides a quick starting point to view sample code and find more complex apps built with GenHTTP. See the documentation for all available capabilities.
Agentic Coding
GenHTTP powers genhttp.dev, a public platform that can be used for agentic, spec-driven coding. You can connect your favorite agent via MCP and let it create and directly publish apps.
Engines
GenHTTP runs on different runtime implementations that can simply be switched by changing a single nuget package
reference and a using statement. Engines are tested to be compatible with all modules, so you can switch the runtime
without any further adjustments.
| Engine | Protocols | Performance | Use Cases |
|---|---|---|---|
| Internal | 1.1 | Embedding; web applications behind reverse proxy | |
| Kestrel | 1.1 2 3 | Web applications on the edge | |
| ioxide | 1.1 2 3 | High performance web applications on Linux via io_uring |
Support
If you encounter issues implementing your application, feel free to join our Discord community to get help. For commercial products and projects, GenHTTP provides additional support options on request.
Building the Server
To build the server from source, clone this repository and run the playground project launcher for .NET 11:
git clone https://github.com/Kaliumhexacyanoferrat/GenHTTP.git
cd ./GenHTTP/Playground
dotnet run
This will build the playground project launcher with all the server dependencies and launch the server process on port 8080.
History
The web server was originally developed in 2008 to run on a netbook with an Intel Atom processor. Both IIS and Apache failed to render dynamic pages on such a slow CPU back then. The original project description can still be found on archive.org. In 2019, the source code has been moved to GitHub with the goal to rework the project to be able to run dockerized web applications written in C#. In 2024 the focus has shifted towards API development, dropping support for generating graphical web applications. In 2026, the API and internal engine have been rewritten to be allocation-free, greatly improving performance in result.
Thanks
- Powered by .NET and the .NET Web Stack
- Modules implemented with ioxide | NSwag | Cottle | SharpCompress
- Monitored by HTTP Arena and HTTP 1.1 Probe
