Support target-free SOCKS5 port mappings with reference protection and UI workflows. Include connection-stage diagnostics, SSH fingerprint confirmation, asset impact checks, listener traffic visibility, SQLite snapshots, account mapping improvements, and MySQL discovery fixes. Update feature rationale and validation docs; Go checks, frontend build and 121 browser tests passed.
28 lines
670 B
Go
28 lines
670 B
Go
package api
|
|
|
|
import "net/http"
|
|
|
|
// readiness reports listener readiness, not upstream connectivity or authentication.
|
|
func (s *Server) readiness(w http.ResponseWriter, r *http.Request) {
|
|
w.Header().Set("Cache-Control", "no-store")
|
|
s.ops.Lock()
|
|
defer s.ops.Unlock()
|
|
proxies, err := s.store.List()
|
|
ready := err == nil
|
|
bound := 0
|
|
for _, p := range proxies {
|
|
if !p.HasDestination() {
|
|
continue
|
|
}
|
|
bound++
|
|
if !s.manager.Status(p.ID).Running {
|
|
ready = false
|
|
}
|
|
}
|
|
if !ready || bound == 0 {
|
|
respond(w, http.StatusServiceUnavailable, map[string]string{"status": "not_ready"})
|
|
return
|
|
}
|
|
respond(w, http.StatusOK, map[string]string{"status": "ready"})
|
|
}
|