{"record":{"id":"1302b6ff43f1cd2b","repo":"tonhowtf/omniget","slug":"proxy-must-include-host-and-port-e-g-http-127-0-0-1-7897","errorCode":null,"errorMessage":"Proxy must include host and port, e.g. http://127.0.0.1:7897","messagePattern":"Proxy must include host and port, e\\.g\\. http://127\\.0\\.0\\.1:7897","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-cli/src/commands/common.rs","lineNumber":56,"sourceCode":"fn 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>()\n        .with_context(|| format!(\"Invalid proxy port: {}\", port))?;\n\n    let (username, password) = match auth.and_then(|a| a.split_once(':')) {\n        Some((u, p)) => (u.to_string(), p.to_string()),\n        None => (String::new(), String::new()),\n    };\n\n    Ok(ProxySettings {\n        enabled: true,\n        proxy_type,\n        host: host.to_string(),","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-cli/src/commands/common.rs#L38-L74","documentation":"After stripping the scheme and any credentials, parse_proxy splits the remaining authority on the last ':' to extract host and port. If there is no colon, the proxy string has no port, which the runtime requires, so this error is raised.","triggerScenarios":"Passing a proxy like 'http://127.0.0.1' or 'http://myproxy' to init_cli_runtime — a host without an explicit ':port' suffix.","commonSituations":"Users assume the default port (8080/1080) is implied; IPv6 addresses or copy-pasted configs that omit the port.","solutions":["Append the explicit port to the proxy URL, e.g. http://127.0.0.1:7897.","If the proxy truly runs on a default port, still write it out: http://proxy:8080 or socks5://proxy:1080.","Verify the full proxy string matches scheme://[user:pass@]host:port."],"exampleFix":"// before\n--proxy http://127.0.0.1\n// after\n--proxy http://127.0.0.1:7897","handlingStrategy":"validation","validationCode":"const m = proxyUrl.match(/^[a-z0-9]+:\\/\\/([^@]+@)?[^:]+:(\\d+)$/);\nif (!m) throw new Error('Proxy needs explicit host and port, e.g. http://127.0.0.1:7897');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never rely on implicit default ports in proxy URLs","Validate proxy strings with a regex before invoking the CLI","Document the expected format scheme://[user:pass@]host:port in team configs"],"tags":["cli","proxy","validation"],"backgroundTag":"missing-required-argument","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"}