Exemplo n.º 1
0
        /// <summary>
        /// Adds ReverseProxy's services to Dependency Injection.
        /// </summary>
        public static IReverseProxyBuilder AddReverseProxy(this IServiceCollection services)
        {
            var builder = new ReverseProxyBuilder(services);

            builder
            .AddConfigBuilder()
            .AddRuntimeStateManagers()
            .AddConfigManager()
            .AddSessionAffinityProvider()
            .AddActiveHealthChecks()
            .AddPassiveHealthCheck()
            .AddProxy();

            services.AddDataProtection();
            services.AddAuthorization();
            services.AddCors();
            services.AddRouting();

            return(builder);
        }
        /// <summary>
        /// Adds ReverseProxy's services to Dependency Injection.
        /// </summary>
        public static IReverseProxyBuilder AddReverseProxy(this IServiceCollection services)
        {
            var builder = new ReverseProxyBuilder(services);

            builder
            .AddConfigBuilder()
            .AddRuntimeStateManagers()
            .AddConfigManager()
            .AddSessionAffinityProvider()
            .AddActiveHealthChecks()
            .AddPassiveHealthCheck()
            .AddLoadBalancingPolicies()
            .AddProxy();

            services.TryAddSingleton <ProxyEndpointFactory>();

            services.AddDataProtection();
            services.AddAuthorization();
            services.AddCors();
            services.AddRouting();

            return(builder);
        }