Skip to content

alexandrejulien/yarp-reverse-proxy

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn
Technical Debt Quality Gate Status Security Rating Code Smells Coverage


Peppermint Yarp reverse-proxy

Peppermint is simple and light .NET reverse proxy based on ASP.NET, Kestrel and implement YARP Project by Microsoft (https://github.com/microsoft/reverse-proxy).
Explore the docs »

· Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. License
  5. Contact

About The Project

Peppermint Reverse Proxy is a simple implementation of Microsoft Yarp Project (https://microsoft.github.io/reverse-proxy/).
It's a out of a box version of Microsoft Yarp Project library, intergrated into a light asp.net application. The objective is to propose a yarp reverse proxy without having to go through a development stage and only the configuration of yarp

Multiples platforms are availables :

  • Portable (.NET Runtime dependency)
  • Win (x86 / x64)
  • Linux (x64)
  • Mac OS (x64) This a light out of the box reverse-proxy application which can be self hosted with Kestrel Web Server (.NET Web Server) or with a IIS in replacement of ARR (Application Request Routing).

YARP offers :

  • HTTP/2 end to end and gPRC capabilties
  • Websockets
  • HttpSys delegation (integration with Http.Sys and IIS)
  • HTTP/3 with .NET 8
  • Loadbalancing
  • A/B Switches
  • Health Checks
  • Transformations
  • TLS customizations
  • Middlewares
  • Logging
  • Tracing with OpenTelemetry

(back to top)

Benchmarks

YARP reverse proxy offers good performances for many workloads but you will loose on heavy workloads without having more resources.

Case Samples Average time (ms) Minimum time (ms) Max time (ms) Throughput (HTTP call/sec) Thread(s)
StaticWebApp - (direct) 10000 0 0 4 830,77 1
StaticWebApp - ARR (IIS) 10000 1 0 4 635,93 1
StaticWebApp -Peppermint Reverse Proxy (Portable) YARP with IIS 10000 1 0 5 627,78 1
ApiWebApp (direct) 10000 0 0 4 3935,45 1
ApiWebApp - ARR (IIS) 10000 0 0 4 1590,07 1
ApiWebApp - PpmintRV Yarp on IIS 10000 0 0 5 1093,37 1

Built With

(back to top)

Getting Started

You have to unzip binairies and configure appsettings.json file

Prerequisites

You have to install ASP.NET 6, 7, 8 runtime. In case of using IIS, you have to install it before with ASP.NET 6, 7 Bundle.

Installation

  1. Get latest release
  2. Configure "appsettings.json" file

(back to top)

Usage

{
  "AllowedHosts": "*",
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Information",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
  "Serilog": {
    "Using": [ "Serilog.Sinks.File" ],
    "MinimumLevel": "Information",
    "WriteTo": [
      {
        "Name": "File",
        "Args": {
          "path": "proxy-.log",
          "rollingInterval": "Day"
        }
      }
    ]
  },
  "ReverseProxy": {
    "Routes": {
      "route1": {
        "ClusterId": "defaultCluster",
        "Match": {
          "Path": "{**catch-all}"
        },
        "Transforms": [
          { "PathPrefix": "/" },
          { "RequestHeadersCopy": "true" },
          { "RequestHeaderOriginalHost": "false" }
        ]
      }
    },
    "Clusters": {
      "defaultCluster": {
        "Destinations": {
          "destination1": {
            "Address": "https://api.ipify.org/"
          }
        },
        "HttpClient": {
          "DangerousAcceptAnyServerCertificate": "true",
          "EnableMultipleHttp2Connections": "true"
        }
      }
    }
  }
}

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Alexandre Julien - @alexandrejulien

Project Link: https://github.com/alexandrejulien/Peppermint.ReverseProxy

(back to top)