Skip to main content

handle_external_proxy

Function handle_external_proxy 

Source
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.

  1. Validate session token
  2. Check host against cloud metadata deny list
  3. Connect to enterprise proxy
  4. Send CONNECT to enterprise proxy (with optional Proxy-Authorization)
  5. Wait for enterprise proxy 200
  6. Bidirectional tunnel: agent <-> enterprise proxy <-> upstream