示例#1
0
        public RequestClient(ClashClient client, ClashClientConfig config)
        {
            _client = client;

            _httpClient = new HttpClient
            {
                BaseAddress = new Uri(BaseUrl)
            };

            _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            _httpClient.DefaultRequestHeaders.Add("Authorization", $"Bearer {config.Token}");

            _semaphore   = new SemaphoreSlim(1);
            _ratelimiter = new Ratelimiter(MaxRequests, RequestTime);
        }
示例#2
0
 public ClashClient(ClashClientConfig config)
 {
     _request = new RequestClient(this, config);
 }