GithubHelp home page GithubHelp logo

ivony.http.pipeline's Introduction

The Http Pipeline is a HTTP request handler similar to a pipeline.

It makes it easy for us to develop a variety of HTTP Network Service components based on aspnet core. For example, API gateways, proxies, reverse proxies, response caching, load balancing, and more.

We can see many network services and components as a combination of a series of more basic components. for example:

a LoadBalanacer can be seen as a combination of Forwarder, Balancer and Emitter.

Forwarder -> Balancer -> Emitter

Forwarder receives and sends requests to the server and forwards them to downstream pipelines.

Balancer distribute request to different downstream pipelines in accordance with the rules.

Emitter sends a request to the server and returns the response

We just need to write code like this.

    // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
    public void Configure( IApplicationBuilder app, IHostingEnvironment env )
    {

      app.UsePipeline( pipeline => pipeline
        .Forward()
        .UseLoadBalancer(
          pipe => pipe.RewriteHost( "10.0.0.1" ),
          pipe => pipe.RewriteHost( "10.0.0.2" ),
          pipe => pipe.RewriteHost( "10.0.0.3" ),
          pipe => pipe.RewriteHost( "10.0.0.4" ),
          pipe => pipe.RewriteHost( "10.0.0.5" )
        )
        .Emit()
      );

    }

So, an API Gateway looks like this:

Forwarder -> AuthenticationFilter -> Router & Rewriter -> Balancer -> Logger -> Emitter

You can create your own network services with any combination of these basic components.

have fun.

performance test result:

  • 40% less average request time compared to Ocelot
  • more than 25% rps compared to Ocelot

Nuget Nuget

ivony.http.pipeline's People

Contributors

ivony avatar

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.