MCPcopy Index your code
hub / github.com/coder/coder / setDERPForcedWebsocket

Method setDERPForcedWebsocket

tailnet/node.go:159–168  ·  view source on GitHub ↗

setDERPForcedWebsocket handles callbacks from the magicConn about DERP regions that are forced to use websockets (instead of Upgrade: derp). This information is for debugging only.

(region int, reason string)

Source from the content-addressed store, hash-verified

157// setDERPForcedWebsocket handles callbacks from the magicConn about DERP regions that are forced to
158// use websockets (instead of Upgrade: derp). This information is for debugging only.
159func (u *nodeUpdater) setDERPForcedWebsocket(region int, reason string) {
160 u.L.Lock()
161 defer u.L.Unlock()
162 dirty := u.derpForcedWebsockets[region] != reason
163 u.derpForcedWebsockets[region] = reason
164 if dirty {
165 u.dirty = true
166 u.Broadcast()
167 }
168}
169
170// setStatus handles the status callback from the wireguard engine to learn about new endpoints
171// (e.g. discovered by STUN). u.L MUST NOT be held

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45