Example #1
0
 public ServerListRequestHandler(ServerListProxy proxy)
 {
     _params         = proxy.Parameters;
     _hostHeader     = $"{_params.Host}:{_params.Port}";
     _serverListPath = $"/servers/list.{_params.Region.ToRegionString()}";
     _servers        = GetAndAdjustServers(proxy);
 }
Example #2
0
        public ServerListProxy(ServerListParameters parameters)
        {
            Parameters = parameters;

            var cfg = new HttpSelfHostConfiguration(
                $"http://{parameters.ServerListAddress}:{parameters.Port}");

            cfg.MessageHandlers.Add(new ServerListRequestHandler(this));

            _server = new HttpSelfHostServer(cfg);
            _server.OpenAsync().Wait();

            _log.Basic("Server list proxy listening at {0}", cfg.BaseAddress);
        }
        public ServerListProxy(ServerListParameters parameters)
        {
            Parameters = parameters ?? throw new ArgumentNullException(nameof(parameters));

            var ep  = parameters.ProxyServerListEndPoint;
            var cfg = new HttpSelfHostConfiguration($"{parameters.Uri.Scheme}://{ep.Address}:{ep.Port}")
            {
                MessageHandlers =
                {
                    new ServerListRequestHandler(parameters, out var servers),
                },
            };

            Servers = servers;
            _server = new HttpSelfHostServer(cfg);
        }
Example #4
0
 public ServerListRequestHandler(ServerListParameters parameters,
                                 out IReadOnlyList <ServerInfo> servers)
 {
     _parameters = parameters;
     _servers    = GetAndAdjustServers(out servers);
 }