SagerNet / SagerNet/sing-box

DNS https/h3 transport fails with bare IPv6 server on default port 443

Open Beginner friendly
#4,548 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
38.1k
Forks
4.6k
Avg merge
19d 15h
Merged PRs (30d)
1

Description

Environment

sing-box testing, with_quic

Repro

DNS server:

{ "type": "h3", "server": "2001:db8::1" }

https type same.

Actual

ERROR dns: lookup failed for example.com: parse "https://2001:db8::1/dns-query": invalid port after host

Same address with udp type works fine:

{ "type": "udp", "server": "2001:db8::1" }
Root cause

dns/transport/https.go:81-90 and dns/transport/quic/http3.go:78-86 put bare IPv6 into url.URL.Host without brackets. Only non-443 port goes through net.JoinHostPort (which adds brackets), default 443 builds illegal URL.

Expected

Bare IPv6 with default 443 should work, e.g. bracket IPv6 before building URL.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in dns/transport/https.go:81-90 and dns/transport/quic/http3.go:78-86, where the URL host is built for HTTPS and HTTP/3 DNS transports. Verify the default-443 path with the provided bare IPv6 configuration, then confirm that both transports produce a valid bracketed host while the existing UDP behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.