{"record":{"id":"74147bc9c61c5681","repo":"tonhowtf/omniget","slug":"unsupported-proxy-scheme","errorCode":null,"errorMessage":"Unsupported proxy scheme: {}","messagePattern":"Unsupported proxy scheme: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-cli/src/commands/common.rs","lineNumber":45,"sourceCode":"    }\n\n    Ok(())\n}\n\nfn init_cookie_provider() {\n    ytdlp::set_global_cookie_file_fn(|| {\n        reporter::default_cookie_path().map(|path| path.to_string_lossy().to_string())\n    });\n}\n\nfn parse_proxy(raw: &str) -> Result<ProxySettings> {\n    let (scheme, rest) = raw\n        .split_once(\"://\")\n        .ok_or_else(|| anyhow!(\"Proxy must include a scheme, e.g. http://127.0.0.1:7897\"))?;\n\n    let proxy_type = match scheme {\n        \"http\" | \"https\" | \"socks5\" => scheme.to_string(),\n        other => return Err(anyhow!(\"Unsupported proxy scheme: {}\", other)),\n    };\n\n    let authority = rest.split('/').next().unwrap_or(rest);\n    let (auth, host_port) = match authority.rsplit_once('@') {\n        Some((auth, host_port)) => (Some(auth), host_port),\n        None => (None, authority),\n    };\n\n    let (host, port) = host_port\n        .rsplit_once(':')\n        .ok_or_else(|| anyhow!(\"Proxy must include host and port, e.g. http://127.0.0.1:7897\"))?;\n\n    if host.is_empty() {\n        return Err(anyhow!(\"Proxy host cannot be empty\"));\n    }\n\n    let port = port\n        .parse::<u16>()","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-cli/src/commands/common.rs#L27-L63","documentation":"parse_proxy validates the scheme portion of a user-supplied proxy URL. Only http, https, and socks5 are supported because those are the proxy types the underlying download runtime can configure. Any other scheme (e.g. socks4, ftp, or a URL with no '://') is rejected with this message.","triggerScenarios":"Calling init_cli_runtime with a --proxy value whose scheme is not exactly http, https, or socks5, e.g. 'socks5h://127.0.0.1:7897', 'ftp://proxy:21', or a scheme written with different casing.","commonSituations":"Users copy a proxy URL from a VPN/Clash app that uses socks5h, or omit the scheme entirely and get the earlier split error, or mistype 'httpx://'.","solutions":["Change the proxy URL scheme to http, https, or socks5 (e.g. socks5://127.0.0.1:7897).","If your proxy is socks5h, use socks5:// instead — hostname resolution happens locally with this tool.","Check the proxy address for typos such as an extra character in the scheme."],"exampleFix":"// before\n--proxy socks5h://127.0.0.1:7897\n// after\n--proxy socks5://127.0.0.1:7897","handlingStrategy":"validation","validationCode":"const ALLOWED = new Set(['http', 'https', 'socks5']);\nconst scheme = proxyUrl.split('://')[0];\nif (!ALLOWED.has(scheme)) throw new Error(`Use http, https or socks5, got: ${scheme}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always write the full scheme://host:port form of the proxy URL","Normalize socks5h:// to socks5:// before passing it","Keep proxy examples in config templates with valid schemes"],"tags":["cli","proxy","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}