using FastGithub.ReverseProxy;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
namespace FastGithub
{
    /// 
    /// https反向代理的中间件扩展
    /// 
    public static class ReverseProxyApplicationBuilderExtensions
    {
        /// 
        /// 使用https反向代理中间件
        /// 
        /// 
        /// 
        public static IApplicationBuilder UseHttpsReverseProxy(this IApplicationBuilder app)
        {
            var middleware = app.ApplicationServices.GetRequiredService();
            return app.Use(next => context => middleware.InvokeAsync(context));
        }
    }
}