{"record":{"id":"28cfc49eaba8aa1f","repo":"XTLS/Xray-core","slug":"unsupported-mode","errorCode":null,"errorMessage":"unsupported mode: ","messagePattern":"unsupported mode: ","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/transport_method.go","lineNumber":324,"sourceCode":"// Build implements Buildable.\nfunc (c *SplitHTTPConfig) Build() (proto.Message, error) {\n\tif c.Extra != nil {\n\t\tvar extra SplitHTTPConfig\n\t\tif err := json.Unmarshal(c.Extra, &extra); err != nil {\n\t\t\treturn nil, errors.New(`Failed to unmarshal \"extra\".`).Base(err)\n\t\t}\n\t\textra.Host = c.Host\n\t\textra.Path = c.Path\n\t\textra.Mode = c.Mode\n\t\tc = &extra\n\t}\n\n\tswitch c.Mode {\n\tcase \"\":\n\t\tc.Mode = \"auto\"\n\tcase \"auto\", \"packet-up\", \"stream-up\", \"stream-one\":\n\tdefault:\n\t\treturn nil, errors.New(\"unsupported mode: \" + c.Mode)\n\t}\n\n\t// Priority (client): host > serverName > address\n\tfor k := range c.Headers {\n\t\tif strings.ToLower(k) == \"host\" {\n\t\t\treturn nil, errors.New(`\"headers\" can't contain \"host\"`)\n\t\t}\n\t}\n\n\tif c.XPaddingBytes != (Int32Range{}) && (c.XPaddingBytes.From <= 0 || c.XPaddingBytes.To <= 0) {\n\t\treturn nil, errors.New(\"xPaddingBytes cannot be disabled\")\n\t}\n\n\tif c.XPaddingKey == \"\" {\n\t\tc.XPaddingKey = \"x_padding\"\n\t}\n\n\tif c.XPaddingHeader == \"\" {","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/infra/conf/transport_method.go#L306-L342","documentation":"SplitHTTPConfig.Build() validates the \"mode\" field in a switch at transport_method.go:319-325. Empty defaults to \"auto\"; only \"auto\", \"packet-up\", \"stream-up\", \"stream-one\" pass. Any other string returns this error with the offending value appended. Note: when \"extra\" is present, mode comes from the OUTER config (extra.Mode is overwritten at line 315), so the bad value must be fixed at top level.","triggerScenarios":"splithttp transportSettings with \"mode\": \"stream-up\" variants misspelled (\"streamup\", \"stream_up\"), legacy value \"half-caddy\" from very old XHTTP versions, or arbitrary strings like \"tcp\". Also mode set only inside \"extra\" stays empty (allowed) — the error only fires for explicit non-empty invalid values.","commonSituations":"Configs written for older/newer forks where mode names differ; typos when hand-editing; guides that document a mode this build does not support (check the case list in your version's source).","solutions":["Set \"mode\" to one of: \"auto\" (default), \"packet-up\", \"stream-up\", \"stream-one\"","Omit \"mode\" entirely to get \"auto\"","Fix the value at the top level of transportSettings, not inside \"extra\" — extra's mode is always overwritten","Verify spelling: hyphenated lowercase only, no underscores"],"exampleFix":"// before\n\"mode\": \"streamup\"\n// after\n\"mode\": \"stream-up\"","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"func validSplithttpMode(m string) bool {\n\tswitch m {\n\tcase \"\", \"auto\", \"packet-up\", \"stream-up\", \"stream-one\":\n\t\treturn true\n\t}\n\treturn false\n}","tryCatchPattern":null,"preventionTips":["Set mode only from the allowed set; omit it for auto","Remember extra's mode is ignored — set mode at top level","Use exact hyphenated lowercase spellings"],"tags":["config","splithttp","mode","validation"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}