Skip to content

IPv6 HTTP proxy and direct tunnel hosts use the wrong bracket form #6091

Closed

Description

@Afloat16

Problem

URL.hostname retains brackets around IPv6 literals, while net.connect expects a bare address. IPv6 proxy and bracketed direct connections try resolving [::1] as a hostname. HTTP CONNECT has the inverse problem: bare IPv6 destinations are emitted without required authority brackets.

Reproduction

At master 541cf26, use real ::1 proxy and direct listeners: bracketed socket hosts fail with ENOTFOUND. A local HTTP proxy captures CONNECT 2001:db8::1:443 instead of CONNECT [2001:db8::1]:443. Four new regressions fail on the base, with four existing cases passing.

Expected

Normalize socket hosts to bare literals and format IPv6 CONNECT request targets and Host headers with brackets. Cover HTTP/HTTPS proxy parsing, actual IPv6 connections and captured CONNECT traffic.

Prior work

Screened all 3,221 cached upstream PRs. Earlier cross-platform/default-host changes #21/#23 and CONNECT admission #2145 do not fix the socket-host versus HTTP-authority representations in these helpers. Previous Afloat16 PRs #6046–#6055 are excluded.

Activity

  1. ranxianglei commented on Nov 12, 2026

    @ranxianglei
    Owner

    Fixed in batch PR #6439 (merged).

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions