WIP: Remote port forwarding (close, but outgoing packets are going to the wrong place)

This commit is contained in:
Aram 🍐 2022-01-09 00:51:09 -05:00
parent c19af07342
commit efb05de7e2
5 changed files with 124 additions and 21 deletions

View file

@ -32,3 +32,21 @@ pub async fn port_forward(
PortProtocol::Udp => udp::udp_proxy_server(port_forward, udp_port_pool, bus).await,
}
}
pub async fn remote_port_forward(
port_forward: PortForwardConfig,
_tcp_port_pool: TcpPortPool,
udp_port_pool: UdpPortPool,
wg: Arc<WireGuardTunnel>,
bus: Bus,
) -> anyhow::Result<()> {
info!(
"Remote Tunneling {} [{}]<-[{}] (via [{}])",
port_forward.protocol, port_forward.destination, port_forward.source, &wg.endpoint,
);
match port_forward.protocol {
PortProtocol::Tcp => Ok(()), // TODO: Remote TCP forwarding
PortProtocol::Udp => udp::udp_proxy_server(port_forward, udp_port_pool, bus).await,
}
}