feat: docker cluster demo (frps+3 nodes, M6 auto binary pull, tunnel e2e) + fix SelfAddr/W4F_HOST/bootstrap retry, -frpc flag

This commit is contained in:
2026-08-17 21:57:00 +08:00
parent fd7604cb9c
commit a842198447
8 changed files with 238 additions and 2 deletions

View File

@ -270,7 +270,9 @@ func (h *Handler) handleClusterNodes(w http.ResponseWriter, r *http.Request) {
http.Error(w, "cluster registry not enabled", http.StatusNotFound)
return
}
// Self node goes first so a querier can identify us by Nodes[0].
// Self node goes first so a querier can identify us by Nodes[0]. The
// version we advertise is the newest locally cached frpc (falling back to
// the configured binary path), so peers can bootstrap the same version.
type nodeResp struct {
Addr string `json:"addr"`
Cache []string `json:"cache,omitempty"`
@ -278,7 +280,9 @@ func (h *Handler) handleClusterNodes(w http.ResponseWriter, r *http.Request) {
}
out := make([]nodeResp, 0, 1+len(h.Cluster.NodeList()))
ver := ""
if h.BinaryPath != nil {
if cs := h.Cluster.CachedVersions(); len(cs) > 0 {
ver = cs[len(cs)-1]
} else if h.BinaryPath != nil {
ver = frpcVersionOf(h.BinaryPath())
}
out = append(out, nodeResp{Addr: h.SelfAddr, Cache: h.Cluster.CachedVersions(), Version: ver})