Skip to main content

spawn_tcp_proxy

Function spawn_tcp_proxy 

Source
pub fn spawn_tcp_proxy(
    handle: &Handle,
    dst: SocketAddr,
    from_smoltcp: Receiver<Bytes>,
    to_smoltcp: Sender<Bytes>,
    shared: Arc<SharedState>,
)
Expand description

Spawn a TCP proxy task for a newly established connection.

Connects to dst via tokio, then bidirectionally relays data between the smoltcp socket (via channels) and the real server. Wakes the poll thread via shared.proxy_wake whenever data is sent toward the guest.