{"record":{"id":"ea9b036e7e73b442","repo":"XTLS/Xray-core","slug":"failed-to-load-inbound-detour-config-for-protocol","errorCode":null,"errorMessage":"failed to load inbound detour config for protocol {c.Protocol}","messagePattern":"failed to load inbound detour config for protocol (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/xray.go","lineNumber":196,"sourceCode":"\t\t\tlen(receiverSettings.PortList.Ports()) != 1 || receiverSettings.PortList.Ports()[0] != 443) {\n\t\t\terrors.LogWarning(context.Background(), `REALITY: Listening on non-443 ports will increase the likelihood of your server's IP being blocked by the GFW`)\n\t\t}\n\t}\n\tif c.SniffingConfig != nil {\n\t\ts, err := c.SniffingConfig.Build()\n\t\tif err != nil {\n\t\t\treturn nil, errors.New(\"failed to build sniffing config\").Base(err)\n\t\t}\n\t\treceiverSettings.SniffingSettings = s\n\t}\n\n\tsettings := []byte(\"{}\")\n\tif c.Settings != nil {\n\t\tsettings = ([]byte)(*c.Settings)\n\t}\n\trawConfig, err := inboundConfigLoader.LoadWithID(settings, c.Protocol)\n\tif err != nil {\n\t\treturn nil, errors.New(\"failed to load inbound detour config for protocol \", c.Protocol).Base(err)\n\t}\n\tif dokodemoConfig, ok := rawConfig.(*DokodemoConfig); ok {\n\t\treceiverSettings.ReceiveOriginalDestination = dokodemoConfig.FollowRedirect\n\t}\n\tts, err := rawConfig.(Buildable).Build()\n\tif err != nil {\n\t\treturn nil, errors.New(\"failed to build inbound handler for protocol \", c.Protocol).Base(err)\n\t}\n\n\treturn &core.InboundHandlerConfig{\n\t\tTag:              c.Tag,\n\t\tReceiverSettings: serial.ToTypedMessage(receiverSettings),\n\t\tProxySettings:    serial.ToTypedMessage(ts),\n\t}, nil\n}\n\ntype OutboundDetourConfig struct {\n\tProtocol       string           `json:\"protocol\"`","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/infra/conf/xray.go#L178-L214","documentation":"Error \"failed to load inbound detour config for protocol {c.Protocol}\" thrown in XTLS/Xray-core.","triggerScenarios":"Thrown at infra/conf/xray.go:196 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}