{"record":{"id":"7ed504ca75c00615","repo":"XTLS/Xray-core","slug":"target-not-specified-7ed504","errorCode":null,"errorMessage":"target not specified.","messagePattern":"target not specified\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/loopback/loopback.go","lineNumber":26,"sourceCode":"\t\"github.com/xtls/xray-core/common/errors\"\n\t\"github.com/xtls/xray-core/common/session\"\n\t\"github.com/xtls/xray-core/core\"\n\t\"github.com/xtls/xray-core/features/routing\"\n\t\"github.com/xtls/xray-core/transport\"\n\t\"github.com/xtls/xray-core/transport/internet\"\n)\n\ntype Loopback struct {\n\tinboundTag         string\n\tsniffingRequest    session.SniffingRequest\n\tdispatcherInstance routing.Dispatcher\n}\n\nfunc (l *Loopback) Process(ctx context.Context, link *transport.Link, _ internet.Dialer) error {\n\toutbounds := session.OutboundsFromContext(ctx)\n\tob := outbounds[len(outbounds)-1]\n\tif !ob.Target.IsValid() {\n\t\treturn errors.New(\"target not specified.\")\n\t}\n\tob.Name = \"loopback\"\n\tdestination := ob.Target\n\n\terrors.LogInfo(ctx, \"opening connection to \", destination)\n\tcontent := new(session.Content)\n\tcontent.SkipDNSResolve = true\n\tcontent.SniffingRequest = l.sniffingRequest\n\n\tctx = session.ContextWithContent(ctx, content)\n\tinbound := &session.Inbound{}\n\toriginInbound := session.InboundFromContext(ctx)\n\tif originInbound != nil {\n\t\t// get a shallow copy to avoid modifying the inbound tag in upstream context\n\t\t*inbound = *originInbound\n\t}\n\tinbound.Tag = l.inboundTag\n\tctx = session.ContextWithInbound(ctx, inbound)","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/proxy/loopback/loopback.go#L8-L44","documentation":"Error \"target not specified.\" thrown in XTLS/Xray-core.","triggerScenarios":"Thrown at proxy/loopback/loopback.go:26 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"}