🔌 Add IPv6 support

Co-Authored-By: kiyon <kiyonlin@163.com>
pull/601/head
Fenny 2020-07-14 03:56:05 +02:00
parent 20cba2604b
commit b6f0d6c6ad
1 changed files with 2 additions and 2 deletions

4
app.go
View File

@ -109,7 +109,7 @@ type Settings struct {
ETag bool `json:"etag"` ETag bool `json:"etag"`
// Known networks are "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only) // Known networks are "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only)
// Prefork is not support for IPv6 addresses // Prefork does not support the IPv6 network
// Default: "tcp" // Default: "tcp"
Network string Network string
@ -491,7 +491,7 @@ func (app *App) Listen(address interface{}, tlsconfig ...*tls.Config) error {
// Start prefork // Start prefork
if app.Settings.Prefork { if app.Settings.Prefork {
if app.Settings.Network == "ipv6" || isIPv6(addr) { if app.Settings.Network == "ipv6" || isIPv6(addr) {
log.Fatal("prefork does not support ipv6 networking") log.Fatal("prefork does not support the ipv6 network")
} }
return app.prefork(addr, tlsconfig...) return app.prefork(addr, tlsconfig...)
} }