mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-09 16:11:23 +00:00
prober: support creating multiple probes in ForEachAddr
So that we can e.g. check TLS on multiple ports for a given IP. Updates tailscale/corp#16367 Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: I81d840a4c88138de1cbb2032b917741c009470e6
This commit is contained in:
@@ -39,14 +39,15 @@ func ExampleForEachAddr() {
|
||||
}
|
||||
|
||||
// This function is called every time we discover a new IP address to check.
|
||||
makeTLSProbe := func(addr netip.Addr) *prober.Probe {
|
||||
makeTLSProbe := func(addr netip.Addr) []*prober.Probe {
|
||||
pf := prober.TLSWithIP(*hostname, netip.AddrPortFrom(addr, 443))
|
||||
if *verbose {
|
||||
logger := logger.WithPrefix(log.Printf, fmt.Sprintf("[tls %s]: ", addr))
|
||||
pf = probeLogWrapper(logger, pf)
|
||||
}
|
||||
|
||||
return p.Run(fmt.Sprintf("website/%s/tls", addr), every30s, nil, pf)
|
||||
probe := p.Run(fmt.Sprintf("website/%s/tls", addr), every30s, nil, pf)
|
||||
return []*prober.Probe{probe}
|
||||
}
|
||||
|
||||
// Determine whether to use IPv4 or IPv6 based on whether we can create
|
||||
|
Reference in New Issue
Block a user