{"record":{"id":"431d2a4e716d71b7","repo":"XTLS/Xray-core","slug":"target-not-specified-431d2a","errorCode":null,"errorMessage":"target not specified","messagePattern":"target not specified","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/hysteria/client.go","lineNumber":57,"sourceCode":"\tif config.Server == nil {\n\t\treturn nil, errors.New(`no target server found`)\n\t}\n\tserver, err := protocol.NewServerSpecFromPB(config.Server)\n\tif err != nil {\n\t\treturn nil, errors.New(\"failed to get server spec\").Base(err)\n\t}\n\n\treturn &Client{\n\t\tserver:        server,\n\t\tpolicyManager: p,\n\t}, nil\n}\n\nfunc (c *Client) Process(ctx context.Context, link *transport.Link, dialer 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 = \"hysteria\"\n\tob.CanSpliceCopy = 3\n\ttarget := ob.Target\n\n\tconn, err := dialer.Dial(hysteria.ContextWithDatagram(ctx, target.Network == net.Network_UDP), c.server.Destination)\n\tif err != nil {\n\t\treturn errors.New(\"failed to find an available destination\").AtWarning().Base(err)\n\t}\n\tdefer conn.Close()\n\terrors.LogInfo(ctx, \"tunneling request to \", target, \" via \", target.Network, \":\", c.server.Destination.NetAddr())\n\n\tvar newCtx context.Context\n\tvar newCancel context.CancelFunc\n\tif session.TimeoutOnlyFromContext(ctx) {\n\t\tnewCtx, newCancel = context.WithCancel(context.Background())\n\t}\n","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/proxy/hysteria/client.go#L39-L75","documentation":"Error \"target not specified\" thrown in XTLS/Xray-core.","triggerScenarios":"Thrown at proxy/hysteria/client.go:57 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"}