{"record":{"id":"31911ef0a2f724fb","repo":"XTLS/Xray-core","slug":"not-hysteria-transport","errorCode":null,"errorMessage":"not hysteria transport","messagePattern":"not hysteria transport","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/hysteria/client.go","lineNumber":37,"sourceCode":"\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/hysteria\"\n\t\"github.com/xtls/xray-core/transport/internet/stat\"\n)\n\ntype Client struct {\n\tserver        *protocol.ServerSpec\n\tpolicyManager policy.Manager\n}\n\nfunc NewClient(ctx context.Context, config *ClientConfig) (*Client, error) {\n\tv := core.MustFromContext(ctx)\n\tp := v.GetFeature(policy.ManagerType()).(policy.Manager)\n\n\tstreamSettings := session.StreamSettingsFromContext(ctx).(*internet.MemoryStreamConfig)\n\tif _, ok := streamSettings.ProtocolSettings.(*hysteria.Config); !ok {\n\t\treturn nil, errors.New(\"not hysteria transport\")\n\t}\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\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]","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/proxy/hysteria/client.go#L19-L55","documentation":"Error \"not hysteria transport\" thrown in XTLS/Xray-core.","triggerScenarios":"Thrown at proxy/hysteria/client.go:37 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"}