Update Vmess

This commit is contained in:
2026-05-02 18:46:46 -03:00
parent 6f677d272a
commit f8fac513e3
3 changed files with 39 additions and 17 deletions

View File

@@ -471,9 +471,14 @@ func (m *XrayManager) AddXrayClient(inboundTag, uuid, email string) error {
}
}
}
settings["clients"] = append(clients, map[string]interface{}{
proto, _ := ibMap["protocol"].(string)
client := map[string]interface{}{
"id": uuid, "email": email, "level": 0,
})
}
if strings.EqualFold(proto, "vmess") {
client["alterId"] = 0
}
settings["clients"] = append(clients, client)
return nil
}
return fmt.Errorf("inbound %q not found", inboundTag)
@@ -578,7 +583,7 @@ func handleXrayClientAdd(w http.ResponseWriter, r *http.Request) {
UUID string `json:"uuid"`
Email string `json:"email"`
Name string `json:"name"`
ExpiresAt string `json:"expires_at"` // RFC3339 or YYYY-MM-DD or empty
ExpiresAt string `json:"expires_at"` // RFC3339 or YYYY-MM-DD or empty
MaxConnections int `json:"max_connections"`
}
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {