Simple gateway (not tested)

This commit is contained in:
2025-08-12 13:38:51 -04:00
parent 914753ca8d
commit 4c543e2d0e
6 changed files with 116 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
use std::{
io::{Read, Write},
net::TcpStream,
};
pub mod gateway;
pub fn route_tcp(from: &mut TcpStream, to: &mut TcpStream) -> bool {
let mut data = [0; 2048];
let bytes_read = from.read(&mut data).unwrap();
if bytes_read == 0 {
return true;
}
to.write_all(&data[..bytes_read]).unwrap();
false
}