mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-05-12 02:36:34 +00:00

- Added a QUIC server to accept streams - Unit test for this server also tests ALPN - Temporary echo capability for HTTP ConnectionType
11 lines
294 B
Go
11 lines
294 B
Go
package utils
|
|
|
|
import "net"
|
|
|
|
func IsIPv4(ip net.IP) bool {
|
|
// If ip is not an IPv4 address, To4 returns nil.
|
|
// Note that there might be some corner cases, where this is not correct.
|
|
// See https://stackoverflow.com/questions/22751035/golang-distinguish-ipv4-ipv6.
|
|
return ip.To4() != nil
|
|
}
|