Support IPv6 for the embedded VNC server and browser proxy

This commit is contained in:
Viktor Liu
2026-07-12 18:46:47 +02:00
parent 6c3dac6fa0
commit 4b946ec219
10 changed files with 183 additions and 63 deletions
+16
View File
@@ -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"
}
}