{"record":{"id":"6e52b7f0430fe39e","repo":"openai/codex","slug":"missing-host-in-network-proxy-address-url","errorCode":null,"errorMessage":"missing host in network proxy address: {url}","messagePattern":"missing host in network proxy address: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/network-proxy/src/config.rs","lineNumber":517,"sourceCode":"\nfn format_host_and_port(host: &str, port: u16) -> String {\n    if host.contains(':') {\n        format!(\"[{host}]:{port}\")\n    } else {\n        format!(\"{host}:{port}\")\n    }\n}\n\n#[derive(Debug, Clone, PartialEq, Eq)]\nstruct SocketAddressParts {\n    host: String,\n    port: u16,\n}\n\nfn parse_host_port(url: &str, default_port: u16) -> Result<SocketAddressParts> {\n    let trimmed = url.trim();\n    if trimmed.is_empty() {\n        bail!(\"missing host in network proxy address: {url}\");\n    }\n\n    // Avoid treating unbracketed IPv6 literals like \"2001:db8::1\" as scheme-prefixed URLs.\n    if matches!(trimmed.parse::<IpAddr>(), Ok(IpAddr::V6(_))) && !trimmed.starts_with('[') {\n        return Ok(SocketAddressParts {\n            host: trimmed.to_string(),\n            port: default_port,\n        });\n    }\n\n    // Prefer the standard URL parser when the input is URL-like. Prefix a scheme when absent so\n    // we still accept loose host:port inputs.\n    let candidate = if trimmed.contains(\"://\") {\n        trimmed.to_string()\n    } else {\n        format!(\"http://{trimmed}\")\n    };\n    if let Ok(parsed) = Url::parse(&candidate)","sourceCodeStart":499,"sourceCodeEnd":535,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/network-proxy/src/config.rs#L499-L535","documentation":"Error \"missing host in network proxy address: {url}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/network-proxy/src/config.rs:517 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}