Function peer_to_http

Source
pub async fn peer_to_http(
    addr: &str,
    client_pools: HttpConnectionPools,
    send: &mut SendStream,
    recv: RecvStream,
) -> Result<()>
Expand description

Handles an incoming P2P request and proxies it to an HTTP server.

Receives a request from a peer over Iroh streams and forwards it to the specified HTTP server address using connection pooling.

§Arguments

  • addr - Target HTTP server address
  • client_pools - HTTP connection pools for reuse
  • send - Stream to send response back to peer
  • recv - Stream to receive request from peer

§Errors

Returns an error if the HTTP request fails or streams are interrupted.