Skip to content

Update webserver.js for ipv4-ipv6 binding fix - #693

Open
1000TurquoisePogs wants to merge 2 commits into
v3.x/stagingfrom
bugfix/v3/ipv4-ipv6-bind
Open

Update webserver.js for ipv4-ipv6 binding fix#693
1000TurquoisePogs wants to merge 2 commits into
v3.x/stagingfrom
bugfix/v3/ipv4-ipv6-bind

Conversation

@1000TurquoisePogs

@1000TurquoisePogs 1000TurquoisePogs commented May 28, 2026

Copy link
Copy Markdown
Member

I found a situation on my system where it appears that although app-server can talk to and bind to ipv6 addresses, the default '0.0.0.0' bind address is interpreted differently on nodejs than other langauges on zos. If other servers wish to talk to :ffff:0.0.0.0, this can fail.

Take a situation where zss needs to talk to app-server, for example.

Node.js interprets 0.0.0.0 as AF_INET on z/OS (pure IPv4), creating the listener at 0.0.0.0..7556. ZSS's C HTTP client uses AF_INET6 (it calls getaddrinfo with AI_V4MAPPED, gets ::ffff:, creates an AF_INET6 socket, and tries to connect). On z/OS, an AF_INET6 socket appears to not be able to connect to an AF_INET listener.

The result, even though both servers are available, they can't talk to each other.

This fixes it by preferring ipv6 binds, but falling back to ipv4.

If a :: or :ffff: ip is given, we bind to that, unless it fails, at which point we retry the ipv4 equivalent.

Utilizes pr zowe/zlux-app-server#374

Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
Signed-off-by: 1000TurquoisePogs <sgrady@rocketsoftware.com>
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

Projects

Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

1 participant