Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 22, 2026

The HttpServer was hardcoding 127.0.0.1 for the endpoint URL instead of reading the actual bound address, and lacked IPv6 support.

Changes

  • Read actual bound address: Extract IP and port from server.address() instead of assuming hardcoded values
  • IPv6 bracket notation: Format IPv6 addresses as [address]:port, IPv4 as address:port
  • Bind to 'localhost': Changed from '127.0.0.1' to allow system DNS resolution to choose IPv4 (127.0.0.1) or IPv6 (::1) loopback
  • Type safety: Import AddressInfo from node:net, add guards for null and string pipe paths
  • Extract formatAddress() helper: Centralize formatting logic with proper IPv6 detection
// Before
const endpoint = `ws://${LOCALHOST_IP}:${this._listeningPort}`;

// After
const addressInfo = this._server.address();
const formattedAddress = formatAddress(addressInfo); // Handles IPv4/IPv6
const endpoint = `ws://${formattedAddress}`;

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 7 commits January 22, 2026 00:04
Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>
…Pv4 or IPv6

Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>
Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>
Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>
Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>
Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>
Co-authored-by: TheLarkInn <3408176+TheLarkInn@users.noreply.github.com>
Copilot AI changed the title [WIP] Update implementation based on feedback for Playwright browser server Read bound address from server.address() and handle IPv6 formatting Jan 22, 2026
Copilot AI requested a review from TheLarkInn January 22, 2026 00:13
@TheLarkInn TheLarkInn marked this pull request as ready for review January 22, 2026 00:31
@TheLarkInn TheLarkInn merged commit e6f1984 into bmiddha/playwright-browser-server Jan 22, 2026
1 check passed
@TheLarkInn TheLarkInn deleted the copilot/sub-pr-5424-another-one branch January 22, 2026 00:31
@github-project-automation github-project-automation bot moved this from Needs triage to Closed in Bug Triage Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

2 participants