{"record":{"id":"b0814850485c48b1","repo":"siyuan-note/siyuan","slug":"unsupported-system-proxy-protocol-s","errorCode":null,"errorMessage":"unsupported system proxy protocol [%s]","messagePattern":"unsupported system proxy protocol \\[(.+?)\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kernel/util/system_proxy.go","lineNumber":108,"sourceCode":"\tif \"\" == ret.HTTPProxy && \"\" == ret.HTTPSProxy {\n\t\treturn nil, fmt.Errorf(\"system proxy does not contain a supported HTTP, HTTPS or SOCKS proxy\")\n\t}\n\treturn ret, nil\n}\n\nfunc normalizeSystemNetworkProxyURL(address, defaultScheme string) (string, error) {\n\taddress = strings.TrimSpace(address)\n\tif !strings.Contains(address, \"://\") {\n\t\taddress = defaultScheme + \"://\" + address\n\t}\n\tproxyURL, err := url.Parse(address)\n\tif err != nil || \"\" == proxyURL.Host {\n\t\treturn \"\", fmt.Errorf(\"invalid system proxy address\")\n\t}\n\tswitch strings.ToLower(proxyURL.Scheme) {\n\tcase \"http\", \"https\", \"socks5\", \"socks5h\":\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unsupported system proxy protocol [%s]\", proxyURL.Scheme)\n\t}\n\treturn proxyURL.String(), nil\n}\n\nfunc parseSystemNetworkProxyBypass(proxyOverride string) string {\n\tentries := []string{}\n\tseen := map[string]bool{}\n\tadd := func(entry string) {\n\t\tif \"\" != entry && !seen[entry] {\n\t\t\tentries = append(entries, entry)\n\t\t\tseen[entry] = true\n\t\t}\n\t}\n\tfor _, field := range strings.Split(proxyOverride, \";\") {\n\t\tfield = strings.TrimSpace(field)\n\t\tif strings.EqualFold(field, \"<local>\") {\n\t\t\tadd(\"localhost\")\n\t\t\tadd(\"127.0.0.1\")","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/util/system_proxy.go#L90-L126","documentation":"normalizeSystemNetworkProxyURL accepts only http, https, socks5 and socks5h schemes for system proxies. A parsed proxy URL whose scheme is anything else (ftp, socks4, arbitrary strings) is rejected with a formatted message naming the offending scheme.","triggerScenarios":"A system proxy setting uses a scheme like socks4://, ftp://, or a typo like httpx://; scheme case is handled (lowercased) so case is not the issue.","commonSituations":"Legacy SOCKS4 proxies configured at OS level; PAC-less environments with exotic proxy protocols; users pasting a generic URL into the proxy field.","solutions":["Switch the proxy to SOCKS5 (socks5:// or socks5h://) or HTTP(S)","Replace the unsupported scheme in OS proxy settings","Upgrade the proxy software to one supporting SOCKS5/HTTP"],"exampleFix":"// before\nproxyServer = \"socks4://127.0.0.1:1080\"\n// after\nproxyServer = \"socks5://127.0.0.1:1080\"","handlingStrategy":"validation","validationCode":"u, _ := url.Parse(addr); switch strings.ToLower(u.Scheme) { case \"http\",\"https\",\"socks5\",\"socks5h\": default: /* replace proxy */ }","typeGuard":null,"tryCatchPattern":"if _, err := normalizeSystemNetworkProxyURL(addr, \"http\"); err != nil { if strings.Contains(err.Error(), \"unsupported system proxy protocol\") { /* switch to socks5/http */ } }","preventionTips":["Only configure HTTP(S) or SOCKS5 proxies","Migrate legacy SOCKS4 setups to SOCKS5","Document supported schemes wherever proxy settings are entered"],"tags":["proxy","unsupported-protocol","system-config"],"backgroundTag":"unsupported-enum-value","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}