mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-05-26 07:08:01 +00:00
fix(nodes): bind form-encoded posts and skip node inbounds in central xray
The Node model only carried `json:` tags, so when the panel's axios posted form-encoded bodies to /panel/api/nodes/add and /test, Gin's form binder produced a zero-valued Node — empty Name, empty Address, Port=0 — surfacing as "node name is required" and a probe URL of "https://:0/...". Add `form:` tags so add/test bind correctly. Also skip inbounds with NodeID set when building the central xray config; otherwise the central panel tried to listen on ports owned by node-managed inbounds and xray-core failed to start with a bind collision. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -113,6 +113,9 @@ func (s *XrayService) GetXrayConfig() (*xray.Config, error) {
|
||||
if !inbound.Enable {
|
||||
continue
|
||||
}
|
||||
if inbound.NodeID != nil {
|
||||
continue
|
||||
}
|
||||
// get settings clients
|
||||
settings := map[string]any{}
|
||||
json.Unmarshal([]byte(inbound.Settings), &settings)
|
||||
|
||||
Reference in New Issue
Block a user