Changes to be committed:
modified: .gitignore modified: src/client.rs modified: src/server.rs
This commit is contained in:
parent
edb9e01dd7
commit
d89cce67b0
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
||||
target
|
||||
.vscode
|
||||
.vscode
|
@ -17,6 +17,11 @@ pub async fn client_mode(remote_addr: &str) -> io::Result<()> {
|
||||
config.destination("0.0.0.0");
|
||||
config.name("tun0");
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
config.platform(|config| {
|
||||
config.packet_information(true);
|
||||
});
|
||||
|
||||
let tun_device = Arc::new(Mutex::new(tun::create(&config).unwrap()));
|
||||
|
||||
let sock = Arc::new(Mutex::new(UdpSocket::bind("0.0.0.0:59611").await?));
|
||||
|
@ -17,6 +17,11 @@ pub async fn server_mode() -> io::Result<()> {
|
||||
config.address("10.8.0.1");
|
||||
config.name("tun0");
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
config.platform(|config| {
|
||||
config.packet_information(true);
|
||||
});
|
||||
|
||||
let tun_device = Arc::new(Mutex::new(tun::create(&config).unwrap()));
|
||||
|
||||
let sock = Arc::new(Mutex::new(UdpSocket::bind("192.168.0.5:8879".parse::<SocketAddr>().unwrap()).await?));
|
||||
|
Loading…
x
Reference in New Issue
Block a user