Changes to be committed:
modified: src/client.rs modified: src/server.rs
This commit is contained in:
parent
d89cce67b0
commit
149792eee5
@ -16,6 +16,7 @@ pub async fn client_mode(remote_addr: &str) -> io::Result<()> {
|
|||||||
config.netmask("128.0.0.0");
|
config.netmask("128.0.0.0");
|
||||||
config.destination("0.0.0.0");
|
config.destination("0.0.0.0");
|
||||||
config.name("tun0");
|
config.name("tun0");
|
||||||
|
config.up();
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
config.platform(|config| {
|
config.platform(|config| {
|
||||||
|
@ -16,6 +16,7 @@ pub async fn server_mode() -> io::Result<()> {
|
|||||||
let mut config = tun::Configuration::default();
|
let mut config = tun::Configuration::default();
|
||||||
config.address("10.8.0.1");
|
config.address("10.8.0.1");
|
||||||
config.name("tun0");
|
config.name("tun0");
|
||||||
|
config.up();
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
config.platform(|config| {
|
config.platform(|config| {
|
||||||
@ -84,7 +85,7 @@ pub async fn server_mode() -> io::Result<()> {
|
|||||||
info!("{:?} bytes sent to tun", len);
|
info!("{:?} bytes sent to tun", len);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let tun_device_clone_second = tun_device.clone();
|
let tun_device_clone_second = tun_device.clone();
|
||||||
let mut buf = [0; 1024];
|
let mut buf = [0; 1024];
|
||||||
let mut tun = tun_device_clone_second.lock().await;
|
let mut tun = tun_device_clone_second.lock().await;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user