mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: Prepend STUN nodes for DERP (#3787)
This makes Tailscale prefer STUN over DERP when possible.
This commit is contained in:
+2
-2
@@ -24,13 +24,13 @@ func NewDERPMap(ctx context.Context, region *tailcfg.DERPRegion, stunAddrs []str
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("parse port for %q: %w", stunAddr, err)
|
||||
}
|
||||
region.Nodes = append(region.Nodes, &tailcfg.DERPNode{
|
||||
region.Nodes = append([]*tailcfg.DERPNode{{
|
||||
Name: fmt.Sprintf("%dstun%d", region.RegionID, index),
|
||||
RegionID: region.RegionID,
|
||||
HostName: host,
|
||||
STUNOnly: true,
|
||||
STUNPort: port,
|
||||
})
|
||||
}}, region.Nodes...)
|
||||
}
|
||||
|
||||
derpMap := &tailcfg.DERPMap{
|
||||
|
||||
Reference in New Issue
Block a user