Skip to content

Commit

Permalink
Handle /derp/latency-check
Browse files Browse the repository at this point in the history
According to tailscale/tailscale@15fc6cd
the routes `/derp/probe` and `/derp/latency-check` are the same and
different versions of the tailscale client use one or the other
endpoint.

Also handle /derp/latency-check

Fixes: juanfont#2211
  • Loading branch information
nblock committed Nov 6, 2024
1 parent a71a933 commit 89235d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions hscontrol/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ func (h *Headscale) createRouter(grpcMux *grpcRuntime.ServeMux) *mux.Router {
if h.cfg.DERP.ServerEnabled {
router.HandleFunc("/derp", h.DERPServer.DERPHandler)
router.HandleFunc("/derp/probe", derpServer.DERPProbeHandler)
router.HandleFunc("/derp/latency-check", derpServer.DERPProbeHandler)
router.HandleFunc("/bootstrap-dns", derpServer.DERPBootstrapDNSHandler(h.DERPMap))
}

Expand Down
2 changes: 1 addition & 1 deletion hscontrol/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func prometheusMiddleware(next http.Handler) http.Handler {

// Ignore streaming and noise sessions
// it has its own router further down.
if path == "/ts2021" || path == "/machine/map" || path == "/derp" || path == "/derp/probe" || path == "/bootstrap-dns" {
if path == "/ts2021" || path == "/machine/map" || path == "/derp" || path == "/derp/probe" || path == "/derp/latency-check" || path == "/bootstrap-dns" {
next.ServeHTTP(w, r)
return
}
Expand Down

0 comments on commit 89235d3

Please sign in to comment.