Bazı firmalar proxy kullanımına izin vermiyorlar, firmaya proxy kullanım izni var mı sordunuz mu?
firewall taraflı sorun olabilir. sunucu yetkılısıyle ıletısıme gecmelısınız.
Aslında aynı botu kullanıyordum sunucuda sadece 1-2 degisiklik yaptım her turlu botu kullanıyorum sunucuda ama ıstedıgım botta proxy kullandırtamıyorum
function parseProxy(proxyConfig, proxyFormat) {
if (!proxyConfig || !proxyConfig.host || !proxyConfig.port) {
return null;
}
// Basitçe HTTP proxy formatında döndür
if (proxyConfig.username && proxyConfig.password) {
return `http://${proxyConfig.username}:${proxyConfig.password}@${proxyConfig.host}:${proxyConfig.port}`;
} else {
return `http://${proxyConfig.host}:${proxyConfig.port}`;
}
}
// Proxy bağlantı test fonksiyonu - BURAYA EKLENECEK
async function testProxyConnection(proxyConfig) {
try {
// Playwright ile proxy testi yapın
const browser = await chromium.launch({
headless: true,
proxy: {
server: `http://${proxyConfig.host}:${proxyConfig.port}`,
username: proxyConfig.username,
password: proxyConfig.password
}
});
const context = await browser.newContext();
const page = await context.newPage();
try {
await page.goto('http://httpbin.org/ip', {
waitUntil: 'domcontentloaded',
timeout: 15000
});
const content = await page.content();
await browser.close();
if (content.includes('origin')) {
return true;
} else {
throw new Error('Proxy response does not contain origin');
}
} catch (error) {
await browser.close();
throw error;
}
} catch (error) {
throw new Error(`Proxy test failed: ${error.message}`);
}
}
http://${proxyConfig.host}:${proxyConfig.port}`, bu kısmı https://${proxyConfig.host}:${proxyConfig.port}`, olarak kullanınca asagıdakı cıktıyı alıyorum baglanmıyor bir türlü eğer http olarak kullanırsam da hic acmıyor tarayıcıya baglanmıyor kalıyor oyle