mirror of
https://github.com/gofiber/fiber.git
synced 2025-05-31 11:52:41 +00:00
🔌 Add IPv6 support
Co-Authored-By: kiyon <kiyonlin@163.com>
This commit is contained in:
parent
20cba2604b
commit
b6f0d6c6ad
4
app.go
4
app.go
@ -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...)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user