siyuan-note/siyuan · error
unsupported system proxy protocol [%s]
Error message
unsupported system proxy protocol [%s]
What it means
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.
Source
Thrown at kernel/util/system_proxy.go:108
if "" == ret.HTTPProxy && "" == ret.HTTPSProxy {
return nil, fmt.Errorf("system proxy does not contain a supported HTTP, HTTPS or SOCKS proxy")
}
return ret, nil
}
func normalizeSystemNetworkProxyURL(address, defaultScheme string) (string, error) {
address = strings.TrimSpace(address)
if !strings.Contains(address, "://") {
address = defaultScheme + "://" + address
}
proxyURL, err := url.Parse(address)
if err != nil || "" == proxyURL.Host {
return "", fmt.Errorf("invalid system proxy address")
}
switch strings.ToLower(proxyURL.Scheme) {
case "http", "https", "socks5", "socks5h":
default:
return "", fmt.Errorf("unsupported system proxy protocol [%s]", proxyURL.Scheme)
}
return proxyURL.String(), nil
}
func parseSystemNetworkProxyBypass(proxyOverride string) string {
entries := []string{}
seen := map[string]bool{}
add := func(entry string) {
if "" != entry && !seen[entry] {
entries = append(entries, entry)
seen[entry] = true
}
}
for _, field := range strings.Split(proxyOverride, ";") {
field = strings.TrimSpace(field)
if strings.EqualFold(field, "<local>") {
add("localhost")
add("127.0.0.1")View on GitHub (pinned to 8641553a1f)
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
Example fix
// before proxies["http"] = "socks4://127.0.0.1:1080" // after proxies["http"] = "socks5://127.0.0.1:1080"
Defensive patterns
Strategy: validation
Validate before calling
u, err := url.Parse(strings.TrimSpace(proxyAddr))
if err != nil || u.Host == "" {
return fmt.Errorf("invalid system proxy address")
}
switch strings.ToLower(u.Scheme) {
case "http", "https", "socks5", "socks5h", "": // empty gets default scheme
default:
return fmt.Errorf("unsupported system proxy protocol [%s]", u.Scheme)
} Type guard
func isSupportedProxyScheme(addr string) bool {
u, err := url.Parse(addr)
if err != nil || u.Host == "" {
return false
}
switch strings.ToLower(u.Scheme) {
case "http", "https", "socks5", "socks5h":
return true
}
return !strings.Contains(addr, "://") // scheme-less defaults to http
} Try / catch
cfg, err := parseSystemNetworkProxy(proxyServer, proxyOverride)
if err != nil {
logging.LogWarnf("skip system proxy: %s", err)
cfg = nil // proceed without proxy
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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'.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- parse [u] failed: %s
- proxy returned unexpected tunnel data
- URL must start with http:// or https://
- SOCKS5 proxy does not support context dialing
- proxy CONNECT returned %s
AI-assisted analysis of siyuan-note/siyuan@8641553a1f (2026-09-11).
Data as JSON: /api/errors/b0814850485c48b1.
Report an issue: GitHub.