Repository navigation
feat(server): support listen ipv6 (#1094) - #1095
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1094.
Use Fiber's
tcplistener to support IPv4 and IPv6. Build the listening address withnet.JoinHostPortso bare IPv6 hosts such as::and::1work. 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.0and::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.