mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-30 16:29:09 +01:00
Support IPv6 for the embedded VNC server and browser proxy
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// 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"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user