MCPcopy
hub / github.com/tailscale/tailscale / RegisterFallbackTCPHandler

Method RegisterFallbackTCPHandler

tsnet/tsnet.go:1392–1401  ·  view source on GitHub ↗

RegisterFallbackTCPHandler registers a callback which will be called to handle a TCP flow to this tsnet node, for which no listeners will handle. If multiple fallback handlers are registered, they will be called in an undefined order. See FallbackTCPHandler for details on handling a flow. The retu

(cb FallbackTCPHandler)

Source from the content-addressed store, hash-verified

1390//
1391// The returned function can be used to deregister this callback.
1392func (s *Server) RegisterFallbackTCPHandler(cb FallbackTCPHandler) func() {
1393 s.mu.Lock()
1394 defer s.mu.Unlock()
1395 hnd := s.fallbackTCPHandlers.Add(cb)
1396 return func() {
1397 s.mu.Lock()
1398 defer s.mu.Unlock()
1399 delete(s.fallbackTCPHandlers, hnd)
1400 }
1401}
1402
1403// getCert is the GetCertificate function used by ListenTLS.
1404//

Callers 4

TestConnFunction · 0.80
TestFallbackTCPHandlerFunction · 0.80
runMethod · 0.80
runFunction · 0.80

Calls 3

LockMethod · 0.65
UnlockMethod · 0.65
AddMethod · 0.65

Tested by 2

TestConnFunction · 0.64
TestFallbackTCPHandlerFunction · 0.64