cmd/vnet: add wsproxy mode

For hooking up websocket VM clients to natlab.

Updates #13038

Change-Id: Iaf728b9146042f3d0c2d3a5e25f178646dd10951
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2025-03-28 11:59:36 -07:00
committed by Brad Fitzpatrick
parent bf8c8e9e89
commit 2a12e634bf
3 changed files with 184 additions and 0 deletions

View File

@@ -121,6 +121,8 @@ func (c *Config) AddNode(opts ...any) *Node {
n.err = fmt.Errorf("unknown NodeOption %q", o)
}
}
case MAC:
n.mac = o
default:
if n.err == nil {
n.err = fmt.Errorf("unknown AddNode option type %T", o)

View File

@@ -88,6 +88,9 @@ func (s *Server) PopulateDERPMapIPs() error {
if n.IPv4 != "" {
s.derpIPs.Add(netip.MustParseAddr(n.IPv4))
}
if n.IPv6 != "" {
s.derpIPs.Add(netip.MustParseAddr(n.IPv6))
}
}
}
return nil