{"record":{"id":"998046e36306f3c5","repo":"fatedier/frp","slug":"unknown-proxy-config-type","errorCode":null,"errorMessage":"unknown proxy config type","messagePattern":"unknown proxy config type","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/v1/validation/proxy.go","lineNumber":128,"sourceCode":"\tswitch v := c.(type) {\n\tcase *v1.TCPProxyConfig:\n\t\treturn validateTCPProxyConfigForClient(v)\n\tcase *v1.UDPProxyConfig:\n\t\treturn validateUDPProxyConfigForClient(v)\n\tcase *v1.TCPMuxProxyConfig:\n\t\treturn validateTCPMuxProxyConfigForClient(v)\n\tcase *v1.HTTPProxyConfig:\n\t\treturn validateHTTPProxyConfigForClient(v)\n\tcase *v1.HTTPSProxyConfig:\n\t\treturn validateHTTPSProxyConfigForClient(v)\n\tcase *v1.STCPProxyConfig:\n\t\treturn validateSTCPProxyConfigForClient(v)\n\tcase *v1.XTCPProxyConfig:\n\t\treturn validateXTCPProxyConfigForClient(v)\n\tcase *v1.SUDPProxyConfig:\n\t\treturn validateSUDPProxyConfigForClient(v)\n\t}\n\treturn errors.New(\"unknown proxy config type\")\n}\n\nfunc validateTCPProxyConfigForClient(c *v1.TCPProxyConfig) error {\n\treturn nil\n}\n\nfunc validateUDPProxyConfigForClient(c *v1.UDPProxyConfig) error {\n\treturn nil\n}\n\nfunc validateTCPMuxProxyConfigForClient(c *v1.TCPMuxProxyConfig) error {\n\tif err := validateDomainConfigForClient(&c.DomainConfig); err != nil {\n\t\treturn err\n\t}\n\n\tif !slices.Contains([]string{string(v1.TCPMultiplexerHTTPConnect)}, c.Multiplexer) {\n\t\treturn fmt.Errorf(\"not support multiplexer: %s\", c.Multiplexer)\n\t}","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/fatedier/frp/blob/6c8a8d0a97d03b44e9528d30b30c70cb9d61b405/pkg/config/v1/validation/proxy.go#L110-L146","documentation":"Error from ValidateProxyConfigurerForClient: the provided ProxyConfigurer is not one of the known client proxy types (TCP, UDP, TCPMux, HTTP, HTTPS, STCP, XTCP, SUDP). The function switches on the concrete Go type of the configurer; an unregistered or nil-typed configurer falls through to this default. Typically indicates a version mismatch where a newer client config type was constructed but this validation build does not know it, or a custom ProxyConfigurer implementation was passed.","triggerScenarios":"Programmatically calling validation.ValidateProxyConfigurerForClient(c) with a ProxyConfigurer that is nil, a custom struct implementing the interface, or a type introduced after this build; config-file paths normally cannot produce it because the decoder rejects unknown proxy types earlier at JSON decode time.","commonSituations":"Embedding frp as a library and defining a custom proxy type; mixed-version binaries (config decoded by a newer frp, validated by an older one); passing a typed nil pointer (*v1.TCPProxyConfig)(nil) which still matches the type switch but is unusual; plain nil interface hitting the default branch.","solutions":["Use one of the built-in configurers: *v1.TCPProxyConfig, *v1.UDPProxyConfig, *v1.TCPMuxProxyConfig, *v1.HTTPProxyConfig, *v1.HTTPSProxyConfig, *v1.STCPProxyConfig, *v1.XTCPProxyConfig, *v1.SUDPProxyConfig.","If embedding frp, keep library version in sync with the config types you construct (no custom proxy types are supported).","Check for a nil configurer before calling validation."],"exampleFix":"// before\nvar cfg v1.ProxyConfigurer // nil interface\nerr := validation.ValidateProxyConfigurerForClient(cfg)\n\n// after\ncfg := &v1.TCPProxyConfig{\n    ProxyBaseConfig: &v1.ProxyBaseConfig{Name: \"ssh\"},\n    RemotePort: 22,\n}\nerr := validation.ValidateProxyConfigurerForClient(cfg)","handlingStrategy":"type-guard","validationCode":"func isKnownClientProxyType(c v1.ProxyConfigurer) bool {\n    switch c.(type) {\n    case *v1.TCPProxyConfig, *v1.UDPProxyConfig, *v1.TCPMuxProxyConfig,\n        *v1.HTTPProxyConfig, *v1.HTTPSProxyConfig, *v1.STCPProxyConfig,\n        *v1.XTCPProxyConfig, *v1.SUDPProxyConfig:\n        return true\n    }\n    return false\n}","typeGuard":"func isKnownClientProxyType(c v1.ProxyConfigurer) bool {\n    switch c.(type) {\n    case *v1.TCPProxyConfig, *v1.UDPProxyConfig, *v1.TCPMuxProxyConfig,\n        *v1.HTTPProxyConfig, *v1.HTTPSProxyConfig, *v1.STCPProxyConfig,\n        *v1.XTCPProxyConfig, *v1.SUDPProxyConfig:\n        return true\n    default:\n        return false\n    }\n}","tryCatchPattern":"if !isKnownClientProxyType(cfg) {\n    return fmt.Errorf(\"unsupported proxy configurer %T\", cfg)\n}\nif err := validation.ValidateProxyConfigurerForClient(cfg); err != nil { return err }","preventionTips":["Never pass custom or nil ProxyConfigurer implementations into frp validation.","Pin frp library versions so constructed config types match the validator.","Unit-test config generation against the validation package."],"tags":["go-api","proxy","validation","type-switch","version-mismatch"],"backgroundTag":null,"analyzedSha":"6c8a8d0a97d03b44e9528d30b30c70cb9d61b405","analyzedAt":"2026-08-15T06:53:27.215Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}