Retour au Blog
Réseau

Configuration proxy avec BotBrowser

Guide complet pour configurer les proxies SOCKS5, HTTP et HTTPS dans BotBrowser avec correspondance de geolocalisation et integration Playwright.

Pourquoi la configuration proxy est importante

Un profil d'empreinte seul ne suffit pas pour une identite de navigateur coherente. Votre identite reseau doit s'aligner avec les parametres geographiques du profil. BotBrowser offre un support proxy ameliore avec credentials integres.

Types de proxy supportes

  • SOCKS5: socks5://user:pass@host:port - Meilleur pour l'usage general.
  • HTTP: http://user:pass@host:port - Largement disponible.
  • HTTPS: https://user:pass@host:port - Connexion chiffree au serveur proxy.

Configuration de base

const { chromium } = require('playwright-core');

(async () => {
  const browser = await chromium.launch({
    executablePath: '/path/to/botbrowser/chrome',
    args: [
      '--bot-profile=/path/to/profile.enc',
      '--proxy-server=socks5://user:pass@proxy-host:1080',
    ],
    headless: true,
  });

  const context = await browser.newContext();
  const page = await context.newPage();
  await page.goto('https://example.com');
  await browser.close();
})();

Correspondance de geolocalisation

const browser = await chromium.launch({
  executablePath: '/path/to/botbrowser/chrome',
  args: [
    '--bot-profile=/path/to/profile.enc',
    '--proxy-server=socks5://user:pass@de-proxy:1080',
    '--bot-config-timezone=Europe/Berlin',
    '--bot-config-locale=de-DE',
    '--bot-config-languages=de-DE,de,en',
  ],
  headless: true,
});

Configurations regionales courantes

RegionFuseau horaireLocaleLangues
USA EstAmerica/New_Yorken-USen-US,en
USA OuestAmerica/Los_Angelesen-USen-US,en
Royaume-UniEurope/Londonen-GBen-GB,en
AllemagneEurope/Berlinde-DEde-DE,de,en
JaponAsia/Tokyoja-JPja,en
BresilAmerica/Sao_Paulopt-BRpt-BR,pt,en

Service de detection IP personnalise

args: [
  '--proxy-server=socks5://user:pass@proxy:1080',
  '--bot-ip-service=https://your-service.example.com/ip',
],

Verification

const page = await context.newPage();
await page.goto('https://httpbin.org/ip');
const ipData = await page.textContent('body');
console.log('Public IP:', ipData);

const tz = await page.evaluate(() => Intl.DateTimeFormat().resolvedOptions().timeZone);
console.log('Timezone:', tz);

Depannage

Timeout de connexion proxy: Verifiez que l'hote et le port sont accessibles.

Echec d'authentification: Assurez-vous que les caracteres speciaux sont encodes en URL.

Fuites DNS: Les proxies SOCKS5 gerent le DNS par defaut. Pour HTTP, considerez --bot-local-dns.

Etapes suivantes

#proxy#socks5#http#network#configuration