<p dir="auto"><strong>Context:</strong></p>
<ul dir="auto">
<li>Playwright Version: 1.10.0</li>
</ul>
<p dir="auto"><strong>Describe the bug</strong></p>
<p dir="auto">Your <a href="https://playwright.dev/docs/api/class-page" rel="nofollow">API reference</a> declares all your API entities as classes, but your <a href="https://github.com/microsoft/playwright/blob/master/types/types.d.ts#L74">types.d.ts</a> declares the same entities as interfaces.</p>
<p dir="auto">With playwright-webkit with proxy on Windows 10, 11 URL is not opening causing <code class="notranslate">Unable to connect the host</code>. The same is working on macOS. Past reference issues - <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1749809508" data-permission-text="Title is private" data-url="https://github.com/microsoft/playwright/issues/23617" data-hovercard-type="issue" data-hovercard-url="/microsoft/playwright/issues/23617/hovercard" href="https://github.com/microsoft/playwright/issues/23617">#23617</a> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1639325926" data-permission-text="Title is private" data-url="https://github.com/microsoft/playwright/issues/21954" data-hovercard-type="issue" data-hovercard-url="/microsoft/playwright/issues/21954/hovercard" href="https://github.com/microsoft/playwright/issues/21954">#21954</a></p>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: v1.30.0 v1.31.1</li>
<li>Operating System: Windows 10, Windows 11</li>
<li>Browser: Webkit</li>
<li>Other info: <a href="https://github.com/lightbody/browsermob-proxy/releases/tag/browsermob-proxy-2.1.4">BrowserMob Proxy 2.1.4</a></li>
</ul>
<h3 dir="auto">Source code</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I provided exact source code that allows reproducing the issue locally.</li>
</ul>
<p dir="auto"><strong>Scripts</strong></p>
<p dir="auto"><strong>server.js</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="'use strict';
const { webkit } = require('playwright');
(async () =&gt; {
  const browserServer = await webkit.launchServer({
    args: ['--ignore-certificate-errors'],
    proxy: {
      server: &quot;http://127.0.0.1:8081&quot;
    },
    headless: false,
    ignoreHTTPSErrors: true,
    logger: {
      isEnabled: () =&gt; true,
      log: (name, severity, message, args) =&gt; console.log(`${name} ${message}`),
    },
  });
  const wsEndpoint = browserServer.wsEndpoint();
  console.log(wsEndpoint);
})();
"><pre class="notranslate"><span class="pl-s">'use strict'</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> webkit <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'playwright'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-k">const</span> <span class="pl-s1">browserServer</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">webkit</span><span class="pl-kos">.</span><span class="pl-en">launchServer</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
    <span class="pl-c1">args</span>: <span class="pl-kos">[</span><span class="pl-s">'--ignore-certificate-errors'</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
    <span class="pl-c1">proxy</span>: <span class="pl-kos">{</span>
      <span class="pl-c1">server</span>: <span class="pl-s">"http://127.0.0.1:8081"</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-c1">headless</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
    <span class="pl-c1">ignoreHTTPSErrors</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
    <span class="pl-c1">logger</span>: <span class="pl-kos">{</span>
      <span class="pl-en">isEnabled</span>: <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-c1">true</span><span class="pl-kos">,</span>
      <span class="pl-en">log</span>: <span class="pl-kos">(</span><span class="pl-s1">name</span><span class="pl-kos">,</span> <span class="pl-s1">severity</span><span class="pl-kos">,</span> <span class="pl-s1">message</span><span class="pl-kos">,</span> <span class="pl-s1">args</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">name</span><span class="pl-kos">}</span></span> <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">message</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">const</span> <span class="pl-s1">wsEndpoint</span> <span class="pl-c1">=</span> <span class="pl-s1">browserServer</span><span class="pl-kos">.</span><span class="pl-en">wsEndpoint</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">wsEndpoint</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">client.js</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const { webkit } = require('playwright');

(async () =&gt; {
  const browser = await webkit.connect({
    wsEndpoint: `wss://&lt;url&gt;`,
  });
  const page = await browser.newPage();
  await page.goto('https://www.google.com');
  await browser.close();
})();"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-kos">{</span> webkit <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'playwright'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-k">const</span> <span class="pl-s1">browser</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">webkit</span><span class="pl-kos">.</span><span class="pl-en">connect</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
    <span class="pl-c1">wsEndpoint</span>: <span class="pl-s">`wss://&lt;url&gt;`</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">const</span> <span class="pl-s1">page</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">browser</span><span class="pl-kos">.</span><span class="pl-en">newPage</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">goto</span><span class="pl-kos">(</span><span class="pl-s">'https://www.google.com'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">await</span> <span class="pl-s1">browser</span><span class="pl-kos">.</span><span class="pl-en">close</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>Download the <a href="https://github.com/lightbody/browsermob-proxy/releases/download/browsermob-proxy-2.1.4/browsermob-proxy-2.1.4-bin.zip">BrowserMob Proxy</a></li>
<li>Run BrowserMob Proxy - <code class="notranslate">browsermob-proxy.bat</code></li>
<li>Create a Proxy <code class="notranslate">curl -X POST http://localhost:8080/proxy</code></li>
<li>Create a HAR Request <code class="notranslate">curl -X PUT http://localhost:8080/proxy/8081/har</code></li>
<li>Run playwright server <code class="notranslate">node server.js</code></li>
<li>Copy the URL from the console &amp; paste into the client script in wsEndpoint.</li>
<li>Run the client script - <code class="notranslate">node client.js</code></li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">URL should open.</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto"><code class="notranslate">Unable to connect the host</code></p>