{"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":"error","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/8641553a1f07374001902d3ce773285db1292b2d/kernel/util/system_proxy.go#L90-L126","documentation":"When SiYuan reads the system proxy settings it normalizes each proxy address to a URL and only accepts http, https, socks5 and socks5h schemes. If the address parses but carries any other scheme (e.g. socks4, ftp, pac), normalizeSystemNetworkProxyURL rejects it with this error and the system proxy import fails.","triggerScenarios":"parseSystemNetworkProxy is given a ProxyServer string (Windows registry ProxyServer, env-style config) whose address contains a scheme not in the allow-list, e.g. 'socks4=127.0.0.1:1080', 'ftp=http://proxy:8080' or a URL literally starting with 'file://' — normalizeSystemNetworkProxyURL hits the default branch of the scheme switch.","commonSituations":"Users behind corporate proxies configured with SOCKS4, or Windows proxy entries that were pasted from tools emitting exotic schemes; also typos like 'httpx://host:port'.","solutions":["Change the proxy entry to use a supported scheme: http://, https://, socks5:// or socks5h://","If the upstream proxy is SOCKS4, replace it with a SOCKS5-capable proxy or a converter","Remove the scheme entirely (e.g. '127.0.0.1:8080'); the default http scheme is then applied automatically"],"exampleFix":"// before\nproxies[\"http\"] = \"socks4://127.0.0.1:1080\"\n// after\nproxies[\"http\"] = \"socks5://127.0.0.1:1080\"","handlingStrategy":"validation","validationCode":"u, err := url.Parse(strings.TrimSpace(proxyAddr))\nif err != nil || u.Host == \"\" {\n\treturn fmt.Errorf(\"invalid system proxy address\")\n}\nswitch strings.ToLower(u.Scheme) {\ncase \"http\", \"https\", \"socks5\", \"socks5h\", \"\": // empty gets default scheme\ndefault:\n\treturn fmt.Errorf(\"unsupported system proxy protocol [%s]\", u.Scheme)\n}","typeGuard":"func isSupportedProxyScheme(addr string) bool {\n\tu, err := url.Parse(addr)\n\tif err != nil || u.Host == \"\" {\n\t\treturn false\n\t}\n\tswitch strings.ToLower(u.Scheme) {\n\tcase \"http\", \"https\", \"socks5\", \"socks5h\":\n\t\treturn true\n\t}\n\treturn !strings.Contains(addr, \"://\") // scheme-less defaults to http\n}","tryCatchPattern":"cfg, err := parseSystemNetworkProxy(proxyServer, proxyOverride)\nif err != nil {\n\tlogging.LogWarnf(\"skip system proxy: %s\", err)\n\tcfg = nil // proceed without proxy\n}","preventionTips":["Only configure http/https/socks5/socks5h proxies","Omit the scheme and let the default http:// be applied","Validate scheme allow-list before persisting proxy settings"],"tags":["proxy","network","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}