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); }
public ClashClient(ClashClientConfig config) { _request = new RequestClient(this, config); }