explaingit

dotnet/yarp

9,494C#Audience · developerComplexity · 4/5LicenseSetup · moderate

TLDR

A Microsoft open-source toolkit for building custom reverse proxy servers in .NET, you embed it in your own app and configure routing, load balancing, and request forwarding to your needs.

Mindmap

mindmap
  root((yarp))
    What it does
      Reverse proxy toolkit
      Request routing
      Load balancing
    Tech Stack
      C#
      ASP.NET Core
      NuGet
    Use Cases
      API gateway
      Microservices routing
      Custom proxy
    Config Options
      JSON config files
      Code-based API
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build a custom API gateway in .NET that routes requests to different backend services based on rules you define in code.

USE CASE 2

Add load balancing across multiple backend servers to your ASP.NET Core app without a third-party proxy tool.

USE CASE 3

Replace hand-rolled proxy logic inside a .NET microservices system with a maintained, extensible shared library.

Tech stack

C#.NETASP.NET CoreNuGet

Getting it running

Difficulty · moderate Time to first run · 30min

Needs an existing ASP.NET Core project and backend services to proxy to.

Open source under the .NET Foundation, free to use, modify, and distribute.

In plain English

YARP (Yet Another Reverse Proxy) is a Microsoft project that gives .NET developers a toolkit for building their own reverse proxy servers. A reverse proxy sits in front of other servers and forwards incoming requests to the right destination, often handling tasks like load balancing, routing, and security in one place. Rather than a standalone off-the-shelf proxy, YARP is designed to be embedded into your own application and customized. The main idea behind YARP is flexibility. Many internal Microsoft teams were building their own proxies from scratch, each with slightly different requirements. YARP was created to give them a shared foundation they could all extend rather than duplicate. The library exposes its internal pipeline as a set of modules you can replace or modify, so if the default routing logic does not fit your needs, you can swap it out without rebuilding the whole project from source. YARP is built on top of ASP.NET, Microsoft's web framework for .NET. Configuration can be loaded from files or managed entirely in code via an API, which matters for teams that control routing rules through their own backend systems rather than static config files. To get started, the project offers a NuGet package and a project template. Building from the source requires running a provided script that downloads the correct .NET version automatically. Tests can be run with a single build command. The project is open source under the .NET Foundation and welcomes contributions. Security issues should be reported privately to Microsoft's security team rather than as public issues.

Copy-paste prompts

Prompt 1
Using YARP, write an ASP.NET Core app that routes requests to /api/users to one backend and /api/orders to another.
Prompt 2
Show me how to configure YARP routing rules from a JSON config file in an ASP.NET Core project.
Prompt 3
Write a YARP middleware that adds a custom header to every forwarded request before it reaches the backend.
Prompt 4
How do I set up YARP to load-balance traffic across three backend servers using round-robin in .NET?
Open on GitHub → Explain another repo

← dotnet on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.