Skip to content

net: node on Linux allows opening a connection to 0.0.0.0/:: while on Windows it doesn't #14900

Description

@refack
  • Version: master
  • Platform: Windows
  • Subsystem: net

Refs: #14865
Refs: #14111

Linux converts the ipv6 address "::" to "::1", while windows does not.

This makes server.address().address useless [as a target address] when bound to IPv6 localhost 0.0.0.0 or :: on Windows.

[addition]
Specifically the use of server.address().address for initiating new connection:

const server = net.createServer(() => {});
server.listen();
server.address().address === '::';
net.connect(
  { port: server.address().port, host: server.address().address }
); // throws 'Error: connect EADDRNOTAVAIL :::56210'

While apparently Linux does allow opening a connection to the :: unspecified address

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    netIssues and PRs related to the net subsystem.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions