{"record":{"id":"397e4986f0d88869","repo":"XTLS/Xray-core","slug":"no-target-server-found-397e49","errorCode":null,"errorMessage":"no target server found","messagePattern":"no target server found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/shadowsocks/client.go","lineNumber":32,"sourceCode":"\t\"github.com/xtls/xray-core/common/signal\"\n\t\"github.com/xtls/xray-core/common/task\"\n\t\"github.com/xtls/xray-core/core\"\n\t\"github.com/xtls/xray-core/features/policy\"\n\t\"github.com/xtls/xray-core/transport\"\n\t\"github.com/xtls/xray-core/transport/internet\"\n\t\"github.com/xtls/xray-core/transport/internet/stat\"\n)\n\n// Client is a inbound handler for Shadowsocks protocol\ntype Client struct {\n\tserver        *protocol.ServerSpec\n\tpolicyManager policy.Manager\n}\n\n// NewClient create a new Shadowsocks client.\nfunc NewClient(ctx context.Context, config *ClientConfig) (*Client, error) {\n\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\tv := core.MustFromContext(ctx)\n\tclient := &Client{\n\t\tserver:        server,\n\t\tpolicyManager: v.GetFeature(policy.ManagerType()).(policy.Manager),\n\t}\n\treturn client, nil\n}\n\n// Process implements OutboundHandler.Process().\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]","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/proxy/shadowsocks/client.go#L14-L50","documentation":"Error \"no target server found\" thrown in XTLS/Xray-core.","triggerScenarios":"Thrown at proxy/shadowsocks/client.go:32 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"}