pub async fn handle_external_proxy(
first_line: &str,
stream: &mut TcpStream,
remaining_header: &[u8],
filter: &ProxyFilter,
session_token: &Zeroizing<String>,
external_config: &ExternalProxyConfig,
audit_log: Option<&SharedAuditLog>,
) -> Result<()>Expand description
Handle a CONNECT request by chaining it to an external proxy.
- Validate session token
- Check host against cloud metadata deny list
- Connect to enterprise proxy
- Send CONNECT to enterprise proxy (with optional Proxy-Authorization)
- Wait for enterprise proxy 200
- Bidirectional tunnel: agent <-> enterprise proxy <-> upstream