siyuan-note/siyuan · warning

unsupported system proxy protocol

Error message

unsupported system proxy protocol [%s]

What it means

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.

Solutions

  1. Switch the proxy to SOCKS5 (socks5:// or socks5h://) or HTTP(S)
  2. Replace the unsupported scheme in OS proxy settings
  3. Upgrade the proxy software to one supporting SOCKS5/HTTP

Example fix

// before
proxyServer = "socks4://127.0.0.1:1080"
// after
proxyServer = "socks5://127.0.0.1:1080"
Defensive patterns

Strategy: validation

Validate before calling

u, _ := url.Parse(addr); switch strings.ToLower(u.Scheme) { case "http","https","socks5","socks5h": default: /* replace proxy */ }

Try / catch

if _, err := normalizeSystemNetworkProxyURL(addr, "http"); err != nil { if strings.Contains(err.Error(), "unsupported system proxy protocol") { /* switch to socks5/http */ } }

Prevention

When it happens

Trigger: 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.

Common situations: Legacy SOCKS4 proxies configured at OS level; PAC-less environments with exotic proxy protocols; users pasting a generic URL into the proxy field.

Related errors


AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19). Data as JSON: /api/errors/b0814850485c48b1. Report an issue: GitHub.

Appendix: 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 9f775e8a12)