Skip to main content

Module egress

Module egress 

Source
Expand description

Host-socket egress for guest network traffic.

Instead of forwarding raw IP packets through a utun and relying on kernel routing/NAT, each outbound packet is parsed and driven onto host OS sockets directly. This bypasses kernel routing, VPN interference, and pf issues.

§Architecture

Guest frame → HostEgress::handle_outbound()
  ├─ ICMP → icmp::IcmpProxy (ICMP datagram socket sendto/recv)
  └─ UDP  → udp::UdpProxy   (per-flow host UdpSocket, optionally via SOCKS5)
        ↓
  reply_tx → mpsc → datapath select! → guest FD

Structs§

HostEgress
Top-level host-socket egress that dispatches guest traffic to protocol-specific handlers and manages inbound port forwarding.