{"record":{"id":"ad080eaa96a9ce47","repo":"zeroclaw-labs/zeroclaw","slug":"http-connect-proxy-closed-connection-before-respon","errorCode":null,"errorMessage":"HTTP CONNECT proxy closed connection before response","messagePattern":"HTTP CONNECT proxy closed connection before response","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-config/src/schema.rs","lineNumber":10956,"sourceCode":"            let proxy_addr = format!(\"{proxy_host}:{proxy_port}\");\n\n            let mut tcp = TcpStream::connect(&proxy_addr)\n                .await\n                .with_context(|| format!(\"TCP connect to HTTP proxy {proxy_addr}\"))?;\n\n            // Send HTTP CONNECT request.\n            let connect_req = format!(\n                \"CONNECT {target_host}:{target_port} HTTP/1.1\\r\\nHost: {target_host}:{target_port}\\r\\n\\r\\n\"\n            );\n            tcp.write_all(connect_req.as_bytes()).await?;\n\n            // Read the response (we only need the status line).\n            let mut buf = vec![0u8; 4096];\n            let mut total = 0usize;\n            loop {\n                let n = tcp.read(&mut buf[total..]).await?;\n                if n == 0 {\n                    anyhow::bail!(\"HTTP CONNECT proxy closed connection before response\");\n                }\n                total += n;\n                // Look for end of HTTP headers.\n                if let Some(pos) = find_header_end(&buf[..total]) {\n                    let status_line = std::str::from_utf8(&buf[..pos])\n                        .unwrap_or(\"\")\n                        .lines()\n                        .next()\n                        .unwrap_or(\"\");\n                    if !status_line.contains(\"200\") {\n                        anyhow::bail!(\n                            \"HTTP CONNECT proxy returned non-200 response: {status_line}\"\n                        );\n                    }\n                    break;\n                }\n                if total >= buf.len() {\n                    anyhow::bail!(\"HTTP CONNECT proxy response too large\");","sourceCodeStart":10938,"sourceCodeEnd":10974,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-config/src/schema.rs#L10938-L10974","documentation":"Error \"HTTP CONNECT proxy closed connection before response\" thrown in zeroclaw-labs/zeroclaw.","triggerScenarios":"Thrown at crates/zeroclaw-config/src/schema.rs:10956 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the proxy server is up and supports HTTP CONNECT; verify proxy host and port in config."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}