zeroclaw-labs/zeroclaw · error
HTTP CONNECT proxy returned non-200 response
Error message
HTTP CONNECT proxy returned non-200 response: {status_line} What it means
Raised in the HTTP CONNECT tunneling helper: the proxy answered, but the status line of its response does not contain '200', so the tunnel was not established. The full first line of the proxy's response is included in {status_line} to expose proxy-side refusal reasons (auth required, forbidden target, etc.).
Solutions
- Check the proxy response status line; verify CONNECT target and proxy authentication credentials.
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at crates/zeroclaw-config/src/schema.rs:10967 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23).
Data as JSON: /api/errors/462024e9a0293aa3.
Report an issue: GitHub.
Appendix: source
Thrown at crates/zeroclaw-config/src/schema.rs:10967
// Read the response (we only need the status line).
let mut buf = vec![0u8; 4096];
let mut total = 0usize;
loop {
let n = tcp.read(&mut buf[total..]).await?;
if n == 0 {
anyhow::bail!("HTTP CONNECT proxy closed connection before response");
}
total += n;
// Look for end of HTTP headers.
if let Some(pos) = find_header_end(&buf[..total]) {
let status_line = std::str::from_utf8(&buf[..pos])
.unwrap_or("")
.lines()
.next()
.unwrap_or("");
if !status_line.contains("200") {
anyhow::bail!(
"HTTP CONNECT proxy returned non-200 response: {status_line}"
);
}
break;
}
if total >= buf.len() {
anyhow::bail!("HTTP CONNECT proxy response too large");
}
}
BoxedIo(Box::new(tcp))
}
scheme => {
anyhow::bail!("Unsupported proxy scheme '{scheme}' for WebSocket connections");
}
};
// If the target is wss://, wrap in TLS.View on GitHub (pinned to 88bb9c8533)