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 addressclient_pools- HTTP connection pools for reusesend- Stream to send response back to peerrecv- Stream to receive request from peer
§Errors
Returns an error if the HTTP request fails or streams are interrupted.