mirror of
https://gitcode.com/JianFeeeee/webui4frpc.git
synced 2026-09-20 17:07:57 +00:00
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:
@ -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})
|
||||
|
||||
Reference in New Issue
Block a user