getting close to final proxy... i think

This commit is contained in:
Bojan Kucera 2025-06-08 09:30:12 -04:00
parent 2f070d73f9
commit 413b133a1f
2 changed files with 32 additions and 9 deletions

View file

@ -7,10 +7,10 @@ export class ProxyService {
private logger = new Logger('proxy-service');
private cache: CacheProvider = createCache('hybrid');
private httpClient: HttpClient;
private readonly concurrencyLimit = pLimit(1);
private readonly concurrencyLimit = pLimit(250);
private readonly CACHE_KEY = 'proxy';
private readonly CACHE_TTL = 86400; // 24 hours
private readonly CHECK_TIMEOUT = 3000;
private readonly CHECK_TIMEOUT = 7000;
private readonly CHECK_IP = '99.246.102.205'
private readonly CHECK_URL = 'https://proxy-detection.stare.gg/?api_key=bd406bf53ddc6abe1d9de5907830a955';
private readonly PROXY_SOURCES = [
@ -185,7 +185,7 @@ export class ProxyService {
responseTime: response.responseTime,
};
// console.log('Proxy check result:', proxy);
if (isWorking && JSON.stringify(response.data).includes(this.CHECK_IP)) {
if (isWorking && !JSON.stringify(response.data).includes(this.CHECK_IP)) {
await this.cache.set(`${this.CACHE_KEY}:${proxy.protocol}://${proxy.host}:${proxy.port}`, result, this.CACHE_TTL);
}
// else { // TODO