GithubHelp home page GithubHelp logo

reverseproxy's Introduction

ReverseProxy

A super blazing-fast reverse proxy built using Microsoft YARP (Yet Another Reverse Proxy). Also includes custom load balancing policies in addition to the pre-built policies provided by YARP.

Features

  • Blazing Fast: High performance reverse proxy for your applications.
  • Custom Load Balancing Policies: Tailor the load balancing to your specific needs.
  • Pre-Built Policies: Use a variety of built-in load balancing strategies.

Custom Load Balancing Policies

YARP allows you to define custom load balancing policies to suit your needs. This project includes:

  • IPAddress: Balances requests based on the client's IP address.
  • PartitionKeyQueryValue: Balances requests based on a query parameter (e.g., ?balanceBy={{value}}).
  • PartitionKeyRouteValue: Balances requests based on a route parameter (e.g., /api/{{balanceBy}}).

Pre-Built Policies

YARP ships with the following built-in policies:

  • RoundRobin: Selects a destination by cycling through them in order.
  • Random: Selects a destination randomly.
  • First: Selects the alphabetically first available destination without considering load. Useful for dual destination fail-over systems.
  • PowerOfTwoChoices (default): Selects two random destinations and then picks the one with the least assigned requests. This avoids the overhead of LeastRequests and the worst case for Random where it selects a busy destination.
  • LeastRequests: Selects the destination with the least assigned requests, which requires examining all destinations.

Configuration

You can configure the reverse proxy by modifying the appsettings.json file. Refer to the YARP documentation for detailed configuration options.

{
  "ReverseProxy": {
    "Routes": {
      "route1": {
        "ClusterId": "cluster1",
        "Match": {
          "Path": "{**catch-all}"
        }
      }
    },
    "Clusters": {
      "cluster1": {
        "LoadBalancingPolicy": "RoundRobin",
        "Destinations": {
          "cluster1/destination1": {
            "Address": "https://server-1/"
          },
          "cluster1/destination2": {
            "Address": "https://server-2/"
          },
          "cluster1/destination3": {
            "Address": "https://server-3/"
          },
          "cluster1/destination4": {
            "Address": "https://server-4/"
          }
        }
      }
    }
  }
}

Contributing

Contributions are welcome! Please fork the repository and open a pull request with your changes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

reverseproxy's People

Contributors

swagfin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

georgenjeri-bet

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.