{"record":{"id":"37a27a7edd46f43c","repo":"XTLS/Xray-core","slug":"failed-to-build-loopback-sniffing-request","errorCode":null,"errorMessage":"failed to build loopback sniffing request","messagePattern":"failed to build loopback sniffing request","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/loopback/loopback.go","lineNumber":59,"sourceCode":"\t\t*inbound = *originInbound\n\t}\n\tinbound.Tag = l.inboundTag\n\tctx = session.ContextWithInbound(ctx, inbound)\n\n\terr := l.dispatcherInstance.DispatchLink(ctx, destination, link)\n\tif err != nil {\n\t\treturn errors.New(ctx, \"failed to process loopback connection\").Base(err)\n\t}\n\treturn nil\n}\n\nfunc (l *Loopback) init(config *Config, dispatcherInstance routing.Dispatcher) error {\n\tl.dispatcherInstance = dispatcherInstance\n\tl.inboundTag = config.InboundTag\n\tif config.Sniffing.GetEnabled() {\n\t\trequest, err := proxyman.BuildSniffingRequest(config.Sniffing)\n\t\tif err != nil {\n\t\t\treturn errors.New(\"failed to build loopback sniffing request\").Base(err).AtError()\n\t\t}\n\t\tl.sniffingRequest = request\n\t}\n\treturn nil\n}\n\nfunc init() {\n\tcommon.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {\n\t\tl := new(Loopback)\n\t\terr := core.RequireFeatures(ctx, func(dispatcherInstance routing.Dispatcher) error {\n\t\t\treturn l.init(config.(*Config), dispatcherInstance)\n\t\t})\n\t\treturn l, err\n\t}))\n}\n","sourceCodeStart":41,"sourceCodeEnd":75,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/proxy/loopback/loopback.go#L41-L75","documentation":"Error \"failed to build loopback sniffing request\" thrown in XTLS/Xray-core.","triggerScenarios":"Thrown at proxy/loopback/loopback.go:59 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-15T17:31:12.345Z"}