{"record":{"id":"5dfb63aee5f5d602","repo":"XTLS/Xray-core","slug":"maxconnections-cannot-be-specified-together-with-m","errorCode":null,"errorMessage":"maxConnections cannot be specified together with maxConcurrency","messagePattern":"maxConnections cannot be specified together with maxConcurrency","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/transport_method.go","lineNumber":450,"sourceCode":"\t\t\tc.SeqKey = \"X-Seq\"\n\t\t}\n\t}\n\n\tif c.UplinkDataPlacement != splithttp.PlacementBody && c.UplinkDataKey == \"\" {\n\t\tswitch c.UplinkDataPlacement {\n\t\tcase splithttp.PlacementCookie:\n\t\t\tc.UplinkDataKey = \"x_data\"\n\t\tcase splithttp.PlacementAuto, splithttp.PlacementHeader:\n\t\t\tc.UplinkDataKey = \"X-Data\"\n\t\t}\n\t}\n\n\tif c.ServerMaxHeaderBytes < 0 {\n\t\treturn nil, errors.New(\"invalid negative value of maxHeaderBytes\")\n\t}\n\n\tif c.Xmux.MaxConnections.To > 0 && c.Xmux.MaxConcurrency.To > 0 {\n\t\treturn nil, errors.New(\"maxConnections cannot be specified together with maxConcurrency\")\n\t}\n\tif c.Xmux == (XmuxConfig{}) {\n\t\tc.Xmux.MaxConnections.From = 3\n\t\tc.Xmux.MaxConnections.To = 3\n\t\tc.Xmux.HMaxRequestTimes.From = 600\n\t\tc.Xmux.HMaxRequestTimes.To = 900\n\t\tc.Xmux.HMaxReusableSecs.From = 1800\n\t\tc.Xmux.HMaxReusableSecs.To = 3000\n\t}\n\n\tconfig := &splithttp.Config{\n\t\tHost:                 c.Host,\n\t\tPath:                 c.Path,\n\t\tMode:                 c.Mode,\n\t\tHeaders:              c.Headers,\n\t\tXPaddingBytes:        newRangeConfig(c.XPaddingBytes),\n\t\tXPaddingObfsMode:     c.XPaddingObfsMode,\n\t\tXPaddingKey:          c.XPaddingKey,","sourceCodeStart":432,"sourceCodeEnd":468,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/infra/conf/transport_method.go#L432-L468","documentation":"SplitHTTPConfig.Build() forbids specifying both xmux.maxConnections and xmux.maxConcurrency with positive To values at transport_method.go:449-451. The two knobs are alternative mux sizing strategies — cap the number of connections, or cap concurrency per connection — and both together contradict each other. When neither is set (zero XmuxConfig), defaults are filled at lines 452-459 (maxConnections 3, hMaxRequestTimes 600-900, hMaxReusableSecs 1800-3000).","triggerScenarios":"\"xmux\": {\"maxConnections\": {\"from\": 2, \"to\": 4}, \"maxConcurrency\": {\"from\": 1, \"to\": 2}} — both To > 0. Setting only one of them, or both with To <= 0, does not trigger (though To<=0 is itself suspect).","commonSituations":"Merging xmux tuning snippets from two different guides; editing an existing xmux block by appending instead of replacing fields.","solutions":["Keep only one strategy: either \"maxConnections\" or \"maxConcurrency\" inside \"xmux\"","Or delete the whole \"xmux\" object to accept the built-in defaults"],"exampleFix":"// before\n\"xmux\": { \"maxConnections\": { \"from\": 2, \"to\": 4 }, \"maxConcurrency\": { \"from\": 1, \"to\": 2 } }\n// after\n\"xmux\": { \"maxConnections\": { \"from\": 2, \"to\": 4 } }","handlingStrategy":"validation","validationCode":"// Go: xmux strategies are mutually exclusive\nif cfg.Xmux.MaxConnections.To > 0 && cfg.Xmux.MaxConcurrency.To > 0 {\n\treturn errors.New(\"set only one of xmux.maxConnections / xmux.maxConcurrency\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Choose one xmux sizing knob; delete the other","An empty xmux object gets sane defaults — often best"],"tags":["config","splithttp","xmux","multiplexing"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}