{"record":{"id":"9e0f697f7804aae2","repo":"fatedier/frp","slug":"invalid-transport-protocol-optional-values-are-v","errorCode":null,"errorMessage":"invalid transport.protocol, optional values are %v","messagePattern":"invalid transport\\.protocol, optional values are (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/v1/validation/client.go","lineNumber":169,"sourceCode":"\t\t\terrs = AppendError(errs, fmt.Errorf(\"invalid transport.heartbeatTimeout, heartbeat timeout should not less than heartbeat interval\"))\n\t\t}\n\t}\n\n\tif !lo.FromPtr(c.TLS.Enable) {\n\t\tcheckTLSConfig := func(name string, value string) Warning {\n\t\t\tif value != \"\" {\n\t\t\t\treturn fmt.Errorf(\"%s is invalid when transport.tls.enable is false\", name)\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\n\t\twarnings = AppendError(warnings, checkTLSConfig(\"transport.tls.certFile\", c.TLS.CertFile))\n\t\twarnings = AppendError(warnings, checkTLSConfig(\"transport.tls.keyFile\", c.TLS.KeyFile))\n\t\twarnings = AppendError(warnings, checkTLSConfig(\"transport.tls.trustedCaFile\", c.TLS.TrustedCaFile))\n\t}\n\n\tif !slices.Contains(SupportedTransportProtocols, c.Protocol) {\n\t\terrs = AppendError(errs, fmt.Errorf(\"invalid transport.protocol, optional values are %v\", SupportedTransportProtocols))\n\t}\n\tif !slices.Contains(SupportedWireProtocols, c.WireProtocol) {\n\t\terrs = AppendError(errs, fmt.Errorf(\"invalid transport.wireProtocol, optional values are %v\", SupportedWireProtocols))\n\t}\n\treturn warnings, errs\n}\n\nfunc validateIncludeFiles(files []string) (Warning, error) {\n\tvar errs error\n\tfor _, f := range files {\n\t\tabsDir, err := filepath.Abs(filepath.Dir(f))\n\t\tif err != nil {\n\t\t\terrs = AppendError(errs, fmt.Errorf(\"include: parse directory of %s failed: %v\", f, err))\n\t\t\tcontinue\n\t\t}\n\t\tif _, err := os.Stat(absDir); os.IsNotExist(err) {\n\t\t\terrs = AppendError(errs, fmt.Errorf(\"include: directory of %s not exist\", f))\n\t\t}","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/fatedier/frp/blob/6c8a8d0a97d03b44e9528d30b30c70cb9d61b405/pkg/config/v1/validation/client.go#L151-L187","documentation":"transport.protocol is not in SupportedTransportProtocols. frpc supports a fixed set of control-connection transports — typically \"tcp\", \"kcp\", \"quic\", \"websocket\", \"wss\" (per the version's supported list, echoed in the message). Any other string fails validation.","triggerScenarios":"transport.protocol set to e.g. \"udp\", \"http\", \"ws\" (abbreviation), or a protocol not compiled into the frpc build; also fires on unset custom values only if explicitly set to an invalid string (default \"tcp\" passes).","commonSituations":"Using shorthand 'ws' instead of 'websocket'; expecting 'wss' availability in a build without TLS transport support; typo or trailing whitespace in YAML value.","solutions":["Set transport.protocol to one of the values printed in the error (e.g. \"websocket\" not \"ws\")","Verify the frpc binary supports the protocol (quic/kcp may be absent in some distro builds)","Quote the value and strip whitespace in TOML/YAML"],"exampleFix":"# before\n[transport]\nprotocol = \"ws\"\n\n# after\n[transport]\nprotocol = \"websocket\"","handlingStrategy":"validation","validationCode":"func validProtocol(p string) bool {\n    return slices.Contains(validation.SupportedTransportProtocols, p)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the long forms: \"websocket\"/\"wss\", never \"ws\"","Check protocol support per frpc build (quic/kcp) before configuring"],"tags":["frp","config","transport","protocol","go"],"backgroundTag":null,"analyzedSha":"6c8a8d0a97d03b44e9528d30b30c70cb9d61b405","analyzedAt":"2026-08-15T06:53:27.215Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}