DEV Community

ben
ben

Posted on

PicoServer - Lightweight Cross-Platform Web Request Glue Library

PicoServer is free for personal and commercial use

🛠️ What is PicoServer?

PicoServer is a lightweight cross-platform Web request glue library—a single DLL of just a few dozen KB that can be integrated into any .NET application. It has no dependencies on IIS or Kestrel, features simple non-intrusive integration with business logic, delivers high performance and stability, and has ultra-low resource consumption. It is the perfect fit for lightweight Web APIs, WebSocket real-time communication, edge computing Web services, various gateways, and lightweight streaming media servers alike.

✨ Core Features of PicoServer

📦 Out-of-the-Box Ready

Built-in support for routing, Token/JWT authentication, request parsing, WebAPI, WebSocket, static file service, CORS and more, covering all basic Web scenarios.

🌍 Cross-Platform Compatibility

Based on .NET Standard 2.0, supporting .NET Framework 4.6.1+, .NET Core, .NET 5, .NET 6+ and compatible with Windows, Linux and macOS.

đź”— Glue Capability

Seamlessly works with third-party libraries, embeds into any .NET application without modifying existing business code, enabling non-intrusive integration.

🚀 Blazing Fast & Low Overhead

Asynchronous non-blocking architecture with AOT compilation support for rapid responses. A single DLL of only a few dozen KB that never burdens your main application.

✨ Flexible Custom Integration

Highly customizable via AddRoute and AddMiddleware with full visibility and control over logic—no black-box encapsulation.

❤️ Build WebAPIs Like Writing Regular Methods

Many .NET developers have extensive experience in desktop and device development, with Web development not being their primary focus. PicoServer lets you add Web capabilities to your applications quickly and achieve modern interaction patterns—naturally, just like calling the methods you're familiar with—no need to be a Web expert.

WebAPI in One Line of C# Code

MyAPI.AddRoute("/hello", async (req, resp) => await resp.WriteAsync(@"{""code"":1,""msg"":""Hello PicoServer WebAPI""}"));
Enter fullscreen mode Exit fullscreen mode

WebAPI in One Line of VB.NET Code

MyAPI.AddRoute("/hello", Function(req, resp) resp.WriteAsync(<t>{"code":1,"msg":"Hello PicoServer WebAPI"}</t>.Value))
Enter fullscreen mode Exit fullscreen mode

🎯 When to Choose PicoServer?

PicoServer is the ideal choice for the following scenarios:

  1. Pursuing Minimal Integration

    Need only lightweight Web API or WebSocket functionality, want to avoid cumbersome framework configurations, and prefer out-of-the-box use with just a few lines of code.

  2. Empowering Legacy Projects

    Existing projects based on legacy .NET Framework, or need cross-platform deployment, and want to add Web capabilities quickly without full refactoring.

  3. Web Capability Integration

    Add Web interfaces "effortlessly" to console apps, WinForms, WPF, MAUI, Avalonia, VSTO and other applications for remote management or B/S hybrid architecture.

  4. Resource-Constrained Environments

    Scenarios with strict requirements on DLL size, CPU and memory usage—such as industrial PCs, edge gateways, AI large model MCP calls, etc.

  5. High Customization Needs

    Need to build file transfer, video stream forwarding or intranet penetration gateways, and pursue full logic transparency, no black boxes and easy troubleshooting.

đź§© ASP.NET Core vs PicoServer

Feature ASP.NET Core PicoServer
Positioning Standalone Web project framework Web capability glue library
Integration Method Follows framework specifications, requires project modifications No project modifications, embed with just a few lines of code
Core Advantages Complete Web ecosystem with comprehensive features Lightweight, concise, perfect compatibility with any library

ASP.NET Core is essential for large-scale projects, but PicoServer can help you with rapid prototype validation in the early stages of project development.

When your business outgrows PicoServer's capabilities, you can seamlessly migrate to ASP.NET Core.

Thanks to its minimal design and glue capabilities, PicoServer perfectly supports DI (Dependency Injection).

đź§° The Three Pillars of PicoServer

Don't let its lightweight size of a few dozen KB limit your imagination. PicoServer integrates into your application as a library, providing direct and robust Web capability support.

  1. Route Mapping (AddRoute) — Business Entry

    Precisely handle URL requests, quickly map to custom business logic, and easily return all types of responses such as JSON and web pages.

  2. Middleware (AddMiddleware) — Pre-Request Interception

    Integrate authentication, log auditing, IP filtering and other capabilities that take effect before requests reach business logic. Intercept or allow requests with one click—no modifications to core business code required.

  3. Built-in Security — Out-of-the-Box Protection

    Natively secure routing with directory traversal prevention, built-in simple Token authentication and JWT authentication to quickly secure your interfaces—no additional third-party security libraries needed. SSL is supported (system configuration required).


🚀 Start Your Embedded Integration Journey

Web Connects Everything

"PicoServer handles the connection, you focus on the creation."

Check out the Usage Guide (C#) or Usage Guide (VB.NET) now—start your integration journey with just three lines of code.

Top comments (0)