{"record":{"id":"ee69b6c5c852d97b","repo":"XTLS/Xray-core","slug":"config-unknown-transport-protocol-p","errorCode":null,"errorMessage":"Config: unknown transport protocol:  + p","messagePattern":"Config: unknown transport protocol:  \\+ p","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"infra/conf/transport_internet.go","lineNumber":40,"sourceCode":"\tcase \"kcp\", \"mkcp\":\n\t\treturn \"mkcp\", nil\n\tcase \"grpc\":\n\t\terrors.PrintNonRemovalDeprecatedFeatureWarning(\"gRPC transport (with unnecessary costs, etc.)\", \"XHTTP stream-up H2\")\n\t\treturn \"grpc\", nil\n\tcase \"ws\", \"websocket\":\n\t\terrors.PrintNonRemovalDeprecatedFeatureWarning(\"WebSocket transport (with ALPN http/1.1, etc.)\", \"XHTTP H2 & H3\")\n\t\treturn \"websocket\", nil\n\tcase \"httpupgrade\":\n\t\terrors.PrintNonRemovalDeprecatedFeatureWarning(\"HTTPUpgrade transport (with ALPN http/1.1, etc.)\", \"XHTTP H2 & H3\")\n\t\treturn \"httpupgrade\", nil\n\tcase \"h2\", \"h3\", \"http\":\n\t\treturn \"\", errors.PrintRemovedFeatureError(\"HTTP transport (without header padding, etc.)\", \"XHTTP stream-one H2 & H3\")\n\tcase \"quic\":\n\t\treturn \"\", errors.PrintRemovedFeatureError(\"QUIC transport (without web service, etc.)\", \"XHTTP stream-one H3\")\n\tcase \"hysteria\":\n\t\treturn \"hysteria\", nil\n\tdefault:\n\t\treturn \"\", errors.New(\"Config: unknown transport protocol: \", p)\n\t}\n}\n\ntype StreamConfig struct {\n\tAddress             *Address           `json:\"address\"`\n\tPort                uint16             `json:\"port\"`\n\tMethod              *TransportProtocol `json:\"method\"`\n\tNetwork             *TransportProtocol `json:\"network\"`\n\tSecurity            string             `json:\"security\"`\n\tFinalMask           *FinalMask         `json:\"finalmask\"`\n\tTLSSettings         *TLSConfig         `json:\"tlsSettings\"`\n\tREALITYSettings     *REALITYConfig     `json:\"realitySettings\"`\n\tRAWSettings         *TCPConfig         `json:\"rawSettings\"`\n\tTCPSettings         *TCPConfig         `json:\"tcpSettings\"`\n\tXHTTPSettings       *SplitHTTPConfig   `json:\"xhttpSettings\"`\n\tSplitHTTPSettings   *SplitHTTPConfig   `json:\"splithttpSettings\"`\n\tKCPSettings         *KCPConfig         `json:\"kcpSettings\"`\n\tGRPCSettings        *GRPCConfig        `json:\"grpcSettings\"`","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/infra/conf/transport_internet.go#L22-L58","documentation":"Thrown by TransportProtocol.Build() when the configured transport protocol string does not match any known value. Accepted values include tcp/raw, mkcp/kcp, websocket, httpupgrade, splithttp/xhttp, domainsocket, hysteria; 'h2'/'h3'/'http' and 'quic' are hard-removed features and produce dedicated removal errors instead. Anything else falls through to this unknown-protocol error.","triggerScenarios":"Setting streamSettings.network (or method) to e.g. \"tls\", \"grpc2\", \"TCP\" (case-sensitive where not normalized), or a typo like \"websockets\" triggers this during StreamConfig build.","commonSituations":"Typos in protocol names; using a protocol removed in this fork (plain http/quic); copying configs from a client with different protocol naming.","solutions":["Correct the protocol name to a supported one: tcp, mkcp, websocket, httpupgrade, splithttp, etc.","If you used 'h2', 'h3', 'http' or 'quic', migrate to splithttp (XHTTP H2/H3).","Check for stray whitespace/case differences in the JSON value."],"exampleFix":"// before\n\"network\": \"http\"\n// after\n\"network\": \"splithttp\"","handlingStrategy":"validation","validationCode":"var known = map[string]bool{\"tcp\": true, \"raw\": true, \"mkcp\": true, \"kcp\": true, \"websocket\": true, \"httpupgrade\": true, \"splithttp\": true, \"xhttp\": true, \"domainsocket\": true, \"hysteria\": true}\nif !known[strings.ToLower(p)] {\n    return fmt.Errorf(\"unsupported transport protocol %q\", p)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Maintain a whitelist of supported protocol names in config tooling.","Reject removed protocols (http, h2, h3, quic) at generate time with a migration hint.","Validate network/method fields before the core ever sees them."],"tags":["go","xray","config","validation","transport"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}