chenhg5/cc-connect · error

matrix: invalid proxy URL %q: %w

Error message

matrix: invalid proxy URL %q: %w

What it means

Config validation guard in the Matrix platform factory: the configured proxy URL failed url.Parse, meaning the `proxy` option in config.toml is malformed (bad scheme, control characters, or unsupported format).

Source

Thrown at platform/matrix/matrix.go:104

	}
	autoVerify, _ := opts["auto_verify"].(bool)
	if !autoVerify {
		_, hasKey := opts["auto_verify"]
		if !hasKey {
			autoVerify = true // default true
		}
	}
	proxyURL, _ := opts["proxy"].(string)
	crossSigningPassword, _ := opts["cross_signing_password"].(string)
	if env := os.Getenv("MATRIX_CROSS_SIGNING_PASSWORD"); env != "" {
		crossSigningPassword = env
	}

	httpClient := &http.Client{Timeout: 120 * time.Second}
	if proxyURL != "" {
		u, err := url.Parse(proxyURL)
		if err != nil {
			return nil, fmt.Errorf("matrix: invalid proxy URL %q: %w", proxyURL, err)
		}
		httpClient.Transport = &http.Transport{Proxy: http.ProxyURL(u)}
		slog.Info("matrix: using proxy", "proxy", u.Host)
	}

	return &Platform{
		homeserver:            homeserver,
		accessToken:           accessToken,
		userID:                userID,
		allowFrom:             allowFrom,
		groupReplyAll:         groupReplyAll,
		shareSessionInChannel: shareSession,
		autoJoin:              autoJoin,
		proxyURL:              proxyURL,
		autoVerify:            autoVerify,
		crossSigningPassword:  crossSigningPassword,
		httpClient:            httpClient,
		dedup:                 core.MessageDedup{},

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Fix the proxy URL scheme/host (e.g. http://host:port or socks5://...)
  2. Remove the proxy option to connect directly
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at platform/matrix/matrix.go:104 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/8ab8cc3ad2300f52. Report an issue: GitHub.