mirror of
https://github.com/EasyTier/EasyTier.git
synced 2025-09-27 04:56:07 +08:00
fix run with config, update readme (#118)
This commit is contained in:
@@ -3,7 +3,8 @@
|
|||||||
[](https://github.com/KKRainbow/EasyTier/blob/main/LICENSE)
|
[](https://github.com/KKRainbow/EasyTier/blob/main/LICENSE)
|
||||||
[](https://github.com/KKRainbow/EasyTier/commits/main)
|
[](https://github.com/KKRainbow/EasyTier/commits/main)
|
||||||
[](https://github.com/KKRainbow/EasyTier/issues)
|
[](https://github.com/KKRainbow/EasyTier/issues)
|
||||||
[](https://github.com/KKRainbow/EasyTier/actions/)
|
[](https://github.com/EasyTier/EasyTier/actions/workflows/core.yml)
|
||||||
|
[](https://github.com/EasyTier/EasyTier/actions/workflows/gui.yml)
|
||||||
|
|
||||||
[简体中文](/README_CN.md) | [English](/README.md)
|
[简体中文](/README_CN.md) | [English](/README.md)
|
||||||
|
|
||||||
@@ -259,6 +260,7 @@ Before using the Client Config, you need to modify the Interface Address and Pee
|
|||||||
- [ZeroTier](https://www.zerotier.com/): A global virtual network for connecting devices.
|
- [ZeroTier](https://www.zerotier.com/): A global virtual network for connecting devices.
|
||||||
- [TailScale](https://tailscale.com/): A VPN solution aimed at simplifying network configuration.
|
- [TailScale](https://tailscale.com/): A VPN solution aimed at simplifying network configuration.
|
||||||
- [vpncloud](https://github.com/dswd/vpncloud): A P2P Mesh VPN
|
- [vpncloud](https://github.com/dswd/vpncloud): A P2P Mesh VPN
|
||||||
|
- [Candy](https://github.com/lanthora/candy): A reliable, low-latency, and anti-censorship virtual private network
|
||||||
|
|
||||||
# License
|
# License
|
||||||
|
|
||||||
|
@@ -3,7 +3,8 @@
|
|||||||
[](https://github.com/KKRainbow/EasyTier/blob/main/LICENSE)
|
[](https://github.com/KKRainbow/EasyTier/blob/main/LICENSE)
|
||||||
[](https://github.com/KKRainbow/EasyTier/commits/main)
|
[](https://github.com/KKRainbow/EasyTier/commits/main)
|
||||||
[](https://github.com/KKRainbow/EasyTier/issues)
|
[](https://github.com/KKRainbow/EasyTier/issues)
|
||||||
[](https://github.com/KKRainbow/EasyTier/actions/)
|
[](https://github.com/EasyTier/EasyTier/actions/workflows/core.yml)
|
||||||
|
[](https://github.com/EasyTier/EasyTier/actions/workflows/gui.yml)
|
||||||
|
|
||||||
[简体中文](/README_CN.md) | [English](/README.md)
|
[简体中文](/README_CN.md) | [English](/README.md)
|
||||||
|
|
||||||
@@ -262,6 +263,7 @@ connected_clients:
|
|||||||
- [ZeroTier](https://www.zerotier.com/): 一个全球虚拟网络,用于连接设备。
|
- [ZeroTier](https://www.zerotier.com/): 一个全球虚拟网络,用于连接设备。
|
||||||
- [TailScale](https://tailscale.com/): 一个旨在简化网络配置的 VPN 解决方案。
|
- [TailScale](https://tailscale.com/): 一个旨在简化网络配置的 VPN 解决方案。
|
||||||
- [vpncloud](https://github.com/dswd/vpncloud): 一个 P2P Mesh VPN
|
- [vpncloud](https://github.com/dswd/vpncloud): 一个 P2P Mesh VPN
|
||||||
|
- [Candy](https://github.com/lanthora/candy): 可靠、低延迟、抗审查的虚拟专用网络
|
||||||
|
|
||||||
# 许可证
|
# 许可证
|
||||||
|
|
||||||
|
@@ -205,7 +205,14 @@ impl TomlConfigLoader {
|
|||||||
pub fn new(config_path: &PathBuf) -> Result<Self, anyhow::Error> {
|
pub fn new(config_path: &PathBuf) -> Result<Self, anyhow::Error> {
|
||||||
let config_str = std::fs::read_to_string(config_path)
|
let config_str = std::fs::read_to_string(config_path)
|
||||||
.with_context(|| format!("failed to read config file: {:?}", config_path))?;
|
.with_context(|| format!("failed to read config file: {:?}", config_path))?;
|
||||||
Self::new_from_str(&config_str)
|
let ret = Self::new_from_str(&config_str)?;
|
||||||
|
let old_ns = ret.get_network_identity();
|
||||||
|
ret.set_network_identity(NetworkIdentity::new(
|
||||||
|
old_ns.network_name,
|
||||||
|
old_ns.network_secret.unwrap_or_default(),
|
||||||
|
));
|
||||||
|
|
||||||
|
Ok(ret)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -156,6 +156,9 @@ const PAYLOAD_OFFSET_FOR_NIC_PACKET: usize = max(
|
|||||||
WG_TUNNEL_HEADER_SIZE,
|
WG_TUNNEL_HEADER_SIZE,
|
||||||
) + PEER_MANAGER_HEADER_SIZE;
|
) + PEER_MANAGER_HEADER_SIZE;
|
||||||
|
|
||||||
|
// UDP Tunnel: TUN MTU + 24 (Easy) + 20 (Encrypted) + 8(UDP) + 20(IP) = TUN MTU + 72
|
||||||
|
// TCP Tunnel: TUN MTU + 20 (Easy) + 20 (Encrypted) + 20(TCP) + 20(IP) = TUN MTU + 80
|
||||||
|
|
||||||
const INVALID_OFFSET: usize = usize::MAX;
|
const INVALID_OFFSET: usize = usize::MAX;
|
||||||
|
|
||||||
const fn get_converted_offset(old_hdr_size: usize, new_hdr_size: usize) -> usize {
|
const fn get_converted_offset(old_hdr_size: usize, new_hdr_size: usize) -> usize {
|
||||||
|
Reference in New Issue
Block a user