microsoft / microsoft/playwright

[Feature]: Support for multi-proxy config via Playwright

Open
#42,753 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
96.3k
Forks
6.5k
Avg merge
1d 6h
Merged PRs (30d)
180

Description

### 🚀 Feature Request

Currently, the only way to use a proxy is through [test options in proxy](https://playwright.dev/docs/api/class-testoptions#test-options-proxy). This works fine for most cases, but there is sometimes a need for a more granular approach to control request distribution based on certain rules or controlled randomization of source to the target.

### Example

Example Scenarios -

- User should be able to set authenticated proxy config per session - Already supported
- User should be able to configure domain-based proxy - helps in routing traffic to different proxies for different domains (might also help in geographical distribution based on domain)
- Should be able to configure proxy settings to deny/allow domains - Included domains in proxy config are allowed while rest are denied by default
- Should be able to provide set of proxies and enable proxy rotation - helps in randomizing source for the same target.

### Motivation

Most of these capabilities could be achieved with the help of [PAC files](https://developer.mozilla.org/en-US/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_PAC_file) as well, similar to the description in an issue [here](https://github.com/microsoft/playwright/issues/35101).

It will make playwright better by allowing more specific tests to be performed depending on proxy. More flexibility in proxy allows developers to easily connect to resources required for testing.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing Playwright's existing test options in proxy and the linked PAC-file discussion. Define the intended behavior and scope for per-session, domain-based allow/deny rules, and proxy rotation before identifying the affected API and tests. Done means the supported multi-proxy scenarios are specified and covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
networking, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.