add ipv4-only support for listener

This commit is contained in:
ginuerzh
2022-07-27 15:17:03 +08:00
parent 00bf0c87b4
commit f7be171df5
27 changed files with 181 additions and 33 deletions

5
internal/net/net.go Normal file
View File

@ -0,0 +1,5 @@
package net
func IsIPv4(address string) bool {
return address != "" && address[0] != ':' && address[0] != '['
}