Skip to content

fix(extension): bind spawned servers to 127.0.0.1 instead of localhost#769

Merged
yury-s merged 1 commit into
microsoft:mainfrom
yury-s:fix-ipv6-loopback-timeout
Apr 21, 2026
Merged

fix(extension): bind spawned servers to 127.0.0.1 instead of localhost#769
yury-s merged 1 commit into
microsoft:mainfrom
yury-s:fix-ipv6-loopback-timeout

Conversation

@yury-s
Copy link
Copy Markdown
Member

@yury-s yury-s commented Apr 18, 2026

Refs microsoft/playwright#40226 (root-cause fix; companion to #768 which prevents the follow-on crash).

Summary

Users started hitting connect ETIMEDOUT ::1:<port> after Windows 11 25H2 (build 26200.8246), with matching reports on macOS. The extension spawns Playwright's test-server (and, for "reuse browser", run-server) without specifying --host. Both default to localhost, which Node resolves to ::1 first on dual-stack systems; the server binds IPv6-only, and something on 25H2 (firewall/WFP/MpsSvc defaults appear to be the culprit) then blocks the extension's IPv6 loopback connection.

  • Pass --host 127.0.0.1 to test-server (listing + debug paths) and run-server. IPv4 loopback is reachable on all affected setups.
  • No behavior change on systems that were already working — it just pins the bind address instead of relying on resolver order.
  • Added tests/list-tests.spec.ts "should spawn test-server bound to IPv4 loopback" that asserts the spawn args via the captured log output channel. Verified the test fails when the --host arg is removed.

The existing #768 defensively fixes the resulting Position(-1) crash; this PR removes the trigger.

After the Windows 11 25H2 update the extension started failing with
`connect ETIMEDOUT ::1:<port>` when talking to its spawned test server
and run-server. Node's default `localhost` resolution on affected
systems prefers IPv6, the server binds to `::1`, and the subsequent
IPv6 loopback connection times out (reproducible on macOS too for some
users). Pass `--host 127.0.0.1` explicitly so both servers always bind
to IPv4 loopback, which remains reachable.

Refs: microsoft/playwright#40226
Copy link
Copy Markdown
Member

@pavelfeldman pavelfeldman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stale defender rules problem

@yury-s yury-s requested a review from pavelfeldman April 21, 2026 17:31
@yury-s yury-s merged commit dbeaf8c into microsoft:main Apr 21, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants