コード例 #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>();
        }
コード例 #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;
        }
コード例 #3
0
ファイル: TCPServer2.cs プロジェクト: sulaimangari/SecureDNS
        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;
        }
コード例 #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)
 {
 }
コード例 #5
0
        public ProxyResponsibilityChain(IOptionsMonitor <ProxyResponsibilityChainOptions> Options, IMiddlewareResolver MiddlewareResolver) : base(MiddlewareResolver)
        {
            Options.CurrentValue.GetMiddlewares().ForEach(Middleware => Chain(Middleware));

            Finally(FinalCheck);
        }
コード例 #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)
 {
 }
コード例 #7
0
 public GenericPipeline(IOptions <GenericPipelineOptions <TParameter> > Options, IMiddlewareResolver MiddlewareResolver) : base(MiddlewareResolver)
 {
     Options.Value.Middlewares.Apply(Middleware => Add(Middleware));
 }
コード例 #8
0
 public ServerResponsibilityChain(IMiddlewareResolver MiddlewareResolver) : base(MiddlewareResolver)
 {
     Chain <Quad9TLSMiddleware>();
     //Chain<ServerMiddleware>();
 }