diff --git a/packages/playwright-core/src/remote/playwrightConnection.ts b/packages/playwright-core/src/remote/playwrightConnection.ts index 3098b7aee4..2a664e99ba 100644 --- a/packages/playwright-core/src/remote/playwrightConnection.ts +++ b/packages/playwright-core/src/remote/playwrightConnection.ts @@ -226,6 +226,8 @@ export class PlaywrightConnection { } private async _createOwnedSocksProxy(playwright: Playwright): Promise { + if (!this._options.socksProxyPattern) + return; const socksProxy = new SocksProxy(); socksProxy.setPattern(this._options.socksProxyPattern); playwright.options.socksProxyPort = await socksProxy.listen(0);