Exemple #1
0
        internal BaseMiddlewareFlow(IMiddlewareResolver middlewareResolver)
        {
            if (middlewareResolver == null)
            {
                throw new ArgumentNullException("middlewareResolver",
                                                "An instance of IMiddlewareResolver must be provided. You can use ActivatorMiddlewareResolver.");
            }

            MiddlewareResolver = middlewareResolver;
            MiddlewareTypes    = new List <Type>();
        }
Exemple #2
0
        public UDPServer2(IOptionsMonitor <ProxyResponsibilityChainOptions> ProxyResponsibilityChainOptions, IOptionsMonitor <ProxyServerOptions> ProxyServerOptions, IMiddlewareResolver MiddlewareResolver, ILogger Logger)
        {
            Options = ProxyServerOptions;

            this.MiddlewareResolver = MiddlewareResolver;

            this.ProxyResponsibilityChainOptions = ProxyResponsibilityChainOptions;

            this.Logger = Logger;

            Threads = new List <Task>();

            Server = new UdpClient();

            Affinity = 0;
        }
Exemple #3
0
        public TCPServer2(IOptionsMonitor <ProxyResponsibilityChainOptions> ProxyResponsibilityChainOptions,
                          IOptionsMonitor <ProxyServerOptions> ProxyServerOptions,
                          IMiddlewareResolver MiddlewareResolver,
                          ILogger Logger)
        {
            Options = ProxyServerOptions;

            this.MiddlewareResolver = MiddlewareResolver;

            this.ProxyResponsibilityChainOptions = ProxyResponsibilityChainOptions;

            this.Logger = Logger;

            Threads = new List <Task>();

            TcpListener = new TcpListener(Options.CurrentValue.IPEndPoint);

            Affinity = 0;
        }
Exemple #4
0
 /// <summary>
 /// Creates a new instance of Pipeline.
 /// </summary>
 /// <param name="middlewareResolver">Resolver responsible for resolving instances out of middleware types.</param>
 public Pipeline(IMiddlewareResolver middlewareResolver) : base(middlewareResolver)
 {
 }
Exemple #5
0
        public ProxyResponsibilityChain(IOptionsMonitor <ProxyResponsibilityChainOptions> Options, IMiddlewareResolver MiddlewareResolver) : base(MiddlewareResolver)
        {
            Options.CurrentValue.GetMiddlewares().ForEach(Middleware => Chain(Middleware));

            Finally(FinalCheck);
        }
Exemple #6
0
 /// <summary>
 /// Creates a new asynchronous chain of responsibility.
 /// </summary>
 /// <param name="middlewareResolver">The resolver used to create the middleware types.</param>
 public AsyncResponsibilityChain(IMiddlewareResolver middlewareResolver) : base(middlewareResolver)
 {
 }
 public GenericPipeline(IOptions <GenericPipelineOptions <TParameter> > Options, IMiddlewareResolver MiddlewareResolver) : base(MiddlewareResolver)
 {
     Options.Value.Middlewares.Apply(Middleware => Add(Middleware));
 }
 public ServerResponsibilityChain(IMiddlewareResolver MiddlewareResolver) : base(MiddlewareResolver)
 {
     Chain <Quad9TLSMiddleware>();
     //Chain<ServerMiddleware>();
 }