Hey everyone! ๐
After years of working with ASP.NET and other heavy frameworks, I wanted something simpler, faster, and more transparent for building custom web servers in .NET.
So I built SimpleW โ an open-source library that gives you full control over HTTP handling, without all the magic layers.
๐งฉ What it is
SimpleW is a lightweight web server library for .NET designed to:
- Build HTTP servers in just a few lines of C#
- Handle routes, static files, WebSockets, and middleware easily
- Run on Linux/Windows (tested on Debian, NixOS, and Windows)
- Stay dependency-free and minimal (no ASP.NET Core required)
โก Why I made it
Most .NET web stacks are powerful but complex. I wanted a minimal, hackable server that could be dropped into any app, or used as a base for custom frameworks, game servers, or embedded tools โ while still delivering very good performances.
using System.Net;
using SimpleW;
namespace Sample {
class Program {
static void Main() {
// listen to all IPs on port 2015
var server = new SimpleWServer(IPAddress.Any, 2015);
// find all Controllers classes and serve on the "/api" endpoint
server.AddDynamicContent("/api");
// start non blocking background server
server.Start();
Console.WriteLine("server started at http://localhost:2015/");
// block console for debug
Console.ReadKey();
}
}
// inherit from Controller
public class SomeController : Controller {
// use the Route attribute to target a public method
[Route("GET", "/test")]
public object SomePublicMethod() {
// the Request property contains all data (Url, Headers...) from the client Request
var url = Request.Url;
// the return will be serialized to json and sent as response to client
return new {
message = "Hello World !"
};
}
}
}
Thatโs it โ youโve got a working HTTP server.
Iโd really appreciate any feedback or ideas you might have ๐ !
๐ก Links
- GitHub: https://github.com/stratdev3/SimpleW
- Documentation: https://stratdev3.github.io/SimpleW/
Top comments (0)