Skip to content

feat(server): support listen ipv6 (#1094) - #1095

Merged
qwqcode merged 1 commit into
ArtalkJS:masterfrom
ZxwyWebSite:feat-ipv6
Oct 28, 2026
Merged

qwqcode merged 1 commit into
ArtalkJS:masterfrom
ZxwyWebSite:feat-ipv6

Conversation

@ZxwyWebSite

@ZxwyWebSite ZxwyWebSite commented Jul 5, 2025 •

Copy link
Copy Markdown
Contributor

Fixes #1094.

Use Fiber's tcp listener to support IPv4 and IPv6. Build the listening address with net.JoinHostPort so bare IPv6 hosts such as :: and ::1 work. Hosts with brackets, such as [::1], also work. The same address handling applies to HTTP and HTTPS.

Existing IPv4 loopback bindings remain local and IPv4-only. On systems that support both protocols, wildcard hosts such as 0.0.0.0 and :: accept IPv4 and IPv6 connections. The English and Chinese documentation explains this behavior and the loopback settings.

Rebased onto master. Added 14 live HTTP and HTTPS test cases using the Artalk server, including TLS certificate verification and loopback isolation. IPv6 cases skip when IPv6 loopback is unavailable. All Go tests passed with CGO_ENABLED=0. Server race tests, go vet ./..., and documentation formatting checks also passed.

@qwqcode
qwqcode merged commit 619cf7a into ArtalkJS:master Oct 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

监听 ipv6

2 participants