{"record":{"id":"cd162a0ff9f4b8a5","repo":"fatedier/frp","slug":"invalid-type-s","errorCode":null,"errorMessage":"invalid type [%s]","messagePattern":"invalid type \\[(.+?)\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/legacy/proxy.go","lineNumber":87,"sourceCode":"\n// Proxy Conf Loader\n// DefaultProxyConf creates a empty ProxyConf object by proxyType.\n// If proxyType doesn't exist, return nil.\nfunc DefaultProxyConf(proxyType ProxyType) ProxyConf {\n\treturn NewConfByType(proxyType)\n}\n\n// Proxy loaded from ini\nfunc NewProxyConfFromIni(prefix, name string, section *ini.Section) (ProxyConf, error) {\n\t// section.Key: if key not exists, section will set it with default value.\n\tproxyType := ProxyType(section.Key(\"type\").String())\n\tif proxyType == \"\" {\n\t\tproxyType = ProxyTypeTCP\n\t}\n\n\tconf := DefaultProxyConf(proxyType)\n\tif conf == nil {\n\t\treturn nil, fmt.Errorf(\"invalid type [%s]\", proxyType)\n\t}\n\n\tif err := conf.UnmarshalFromIni(prefix, name, section); err != nil {\n\t\treturn nil, err\n\t}\n\treturn conf, nil\n}\n\n// LocalSvrConf configures what location the client will to, or what\n// plugin will be used.\ntype LocalSvrConf struct {\n\t// LocalIP specifies the IP address or host name to to.\n\tLocalIP string `ini:\"local_ip\" json:\"local_ip\"`\n\t// LocalPort specifies the port to to.\n\tLocalPort int `ini:\"local_port\" json:\"local_port\"`\n\n\t// Plugin specifies what plugin should be used for ng. If this value\n\t// is set, the LocalIp and LocalPort values will be ignored. By default,","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/fatedier/frp/blob/6c8a8d0a97d03b44e9528d30b30c70cb9d61b405/pkg/config/legacy/proxy.go#L69-L105","documentation":"When building a proxy config from a legacy INI section, frp reads the type key (defaulting to tcp when absent) and asks DefaultProxyConf for a struct for that type. If the type string does not map to a known proxy kind (tcp, udp, xtcp, stcp, sudp, http, https, tcpmux), DefaultProxyConf returns nil and this 'invalid type [<type>]' error is returned.","triggerScenarios":"A proxy section like [my-web] with type = http2, type = tcpmuxhttp, or any unsupported/misspelled value. Note the empty string does NOT trigger it — empty defaults to tcp; only non-empty unknown values do.","commonSituations":"Typos in type values; using a type supported by a newer frp version against an older frpc; assuming plugin-based sections still need exotic type values.","solutions":["Set type to a supported value: tcp, udp, xtcp, stcp, sudp, http, https, or tcpmux","Check spelling/case (type values are lowercase)","Confirm the type exists in your frpc version's docs"],"exampleFix":"# before\n[my-proxy]\ntype = tlcp\n\n# after\n[my-proxy]\ntype = stcp","handlingStrategy":"type-guard","validationCode":"validTypes := map[string]bool{\"tcp\":true,\"udp\":true,\"xtcp\":true,\"stcp\":true,\"sudp\":true,\"http\":true,\"https\":true,\"tcpmux\":true}\nif t := section.Key(\"type\").String(); t != \"\" && !validTypes[t] {\n    return fmt.Errorf(\"unsupported proxy type %q\", t)\n}","typeGuard":"func isValidProxyType(t string) bool {\n    switch t {\n    case \"tcp\", \"udp\", \"xtcp\", \"stcp\", \"sudp\", \"http\", \"https\", \"tcpmux\":\n        return true\n    }\n    return false\n}","tryCatchPattern":"if _, err := legacy.NewProxyConfFromIni(prefix, name, section); err != nil && strings.HasPrefix(err.Error(), \"invalid type\") { /* report supported list, fix section */ }","preventionTips":["Generate proxy sections from validated templates","grep configs for type = values and diff against the allowlist in CI","Upgrade frpc/frps together to keep type sets in sync"],"tags":["config","proxy","validation","legacy-ini","frpc"],"backgroundTag":null,"analyzedSha":"6c8a8d0a97d03b44e9528d30b30c70cb9d61b405","analyzedAt":"2026-08-15T06:53:27.215Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}