mirror of
https://github.com/netbirdio/netbird.git
synced 2026-07-20 07:21:27 +02:00
17 lines
422 B
Go
17 lines
422 B
Go
// Package netutil holds small networking helpers shared across the wasm
|
|
// client's proxy paths (SSH, VNC, ping).
|
|
package netutil
|
|
|
|
// TCPNetwork maps an IP-version selector to the net package's TCP network
|
|
// string: 4 -> "tcp4", 6 -> "tcp6", anything else (0/automatic) -> "tcp".
|
|
func TCPNetwork(ipVersion int) string {
|
|
switch ipVersion {
|
|
case 4:
|
|
return "tcp4"
|
|
case 6:
|
|
return "tcp6"
|
|
default:
|
|
return "tcp"
|
|
}
|
|
}
|