public DefaultHttpHandler(IServerLoader serverLoader, ILogger logger = null) { _pipes = new List <DefaultPipe>(); _serverLoader = Throw.IfNull(() => serverLoader); _logger = logger; }
public StandardLocalSocks5Handler(IServerLoader serverLoader, ILogger logger = null) { _pipes = new List <DefaultPipe>(); _serverLoader = Throw.IfNull(() => serverLoader); _logger = logger; }
public HttpProxySever(HttpProxySeverConfig httpProxySeverConfig, IServerLoader serverLoader, ILogger logger = null) { _config = Throw.IfNull(() => httpProxySeverConfig); _serverLoader = Throw.IfNull(() => serverLoader); _logger = logger; ServerConfig serverConfig = new ServerConfig() { BindPoint = _config.GetBindPoint(), MaxNumClient = Defaults.MaxNumClient }; _tcpServer = new TcpServer(serverConfig, logger); }
public LocalServer(LocalServerConfig localServerConfig, IServerLoader serverLoader, ILogger logger = null) { _localServerConfig = Throw.IfNull(() => localServerConfig); _serverLoader = Throw.IfNull(() => serverLoader); _logger = logger; ServerConfig serverConfig = new ServerConfig() { BindPoint = _localServerConfig.GetBindPoint(), MaxNumClient = Defaults.MaxNumClient }; _tcpServer = new TcpServer(serverConfig, _logger); _udpServer = new UdpServer(serverConfig, _logger); }
private void EnsureServerFactory(HostingContext context) { if (context.ServerFactory != null) { return; } if (_serverLoader == null) { _serverLoader = context.ApplicationServices.GetRequiredService<IServerLoader>(); } context.ServerFactory = _serverLoader.LoadServerFactory(context.ServerFactoryLocation); }
public TestServerLoader(IServiceProvider services) { _wrappedServerLoader = new ServerLoader(services); }