cherry-pick(#21848): fix(run-server): do not engage socks when not requested

Fixes #21762.
This commit is contained in:
Dmitry Gozman 2023-03-21 14:06:55 -07:00
parent 98ff2a891a
commit 8693fd4743

View file

@ -226,6 +226,8 @@ export class PlaywrightConnection {
}
private async _createOwnedSocksProxy(playwright: Playwright): Promise<SocksProxy | undefined> {
if (!this._options.socksProxyPattern)
return;
const socksProxy = new SocksProxy();
socksProxy.setPattern(this._options.socksProxyPattern);
playwright.options.socksProxyPort = await socksProxy.listen(0);