Intégration proxy Playwright

Playwright has first-class proxy support, so there is no extension trick or separate authenticate call. Pass a proxy object with server, username and password to launch(), and it applies across Chromium, Firefox and WebKit. You can also set the proxy per context when different pages need different IPs.

run.jsjavascript
import { chromium } from "playwright";

const browser = await chromium.launch({
  proxy: {
    // Residential gateway, or "http://IP:PORT" for one of your ISP proxies.
    server: "http://gw-eu.murphyproxies.com:8888",
    username: "USERNAME",
    password: "PASSWORD",
  },
});

const page = await browser.newPage();
await page.goto("https://httpbin.org/ip");
console.log(await page.textContent("body"));

await browser.close();

// Per-context proxy (e.g. a US exit in one context, an ISP IP in another):
// const context = await browser.newContext({
//   proxy: { server: "http://gw-usa.murphyproxies.com:8888",
//            username: "USERNAME", password: "PASSWORD" },
// });

Configuration en 5 étapes

  1. 1Install the client with npm install playwright.
  2. 2Pass a proxy object (server, username, password) to chromium.launch().
  3. 3Point server at http://gw-eu.murphyproxies.com:8888 (another gw- region, port 7777 on Private 2, or http://IP:PORT for an ISP proxy) with the credentials from your dashboard.
  4. 4Open a page and navigate to an IP echo endpoint to verify the exit IP.
  5. 5Move the proxy onto newContext() when you need separate IPs across parallel work.

Questions sur les proxies Playwright

Tout ce qu'il faut pour faire passer Playwright par Murphy, de l'authentification à la rotation.

Récupérez vos identifiants pour Playwright

Choisissez le réseau selon votre cible : les proxies ISP pour des sessions rapides et stables, les résidentiels pour multiplier les IP face aux anti-bots les plus stricts.