-
-
-
+
+
+
+
+
白名单
+
-
+
- {{ !data.isStart ? "启动联机" : "停止联机" }}
-
-
-
- 导入配置
-
-
- 分享配置
-
-
- 使用外部配置文件
-
-
-
-
-
-
-
-
- 强制中转
-
-
-
+
+ {{ data.coreVersion }}
+
+
+
+
- 开机自启
-
-
-
-
- 子网代理
-
-
- 高级选项
+ 内核管理
-
-
-
- 增强工具
-
-
-
- EasytierGame主页
-
+
+
+
+
+
+
+ 启用白名单
+ 转发所有对等节点的RPC数据包
+
+
+
-
+
+
+
+
+
+ {{
+ !data.isStart
+ ? mainStore.enableCreateServer
+ ? "启动服务"
+ : "启动联机"
+ : mainStore.enableCreateServer
+ ? "停止服务"
+ : "停止联机"
+ }}
+
+
+
+ 导入配置
+
+
+ 分享联机相关配置
+
+
+ {{ mainStore.enableCreateServer ? "我要联机" : "我要开服(自建)" }}
+
+
+ 使用外部配置文件
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 强制中转
+
+
+
+ 开机自启
+
+
+
+
+ 子网代理
+
+
+ 高级选项
+
+
+
+
+
+ 增强工具
+
+
+
+ EasytierGame主页
+
+
+
+
{
- is_close = true;
- await invoke("stop_command", { child_id: listenObj.thread_id || 0 });
- await invoke("stop_command", { child_id: data.winipBcPid || 0 });
- }, async () => {
- await handleConnection();
- return data.isStart
- });
+ const tray = await useTray(
+ true,
+ async () => {
+ is_close = true;
+ await invoke("stop_command", { child_id: listenObj.thread_id || 0 });
+ await invoke("stop_command", { child_id: data.winipBcPid || 0 });
+ },
+ async () => {
+ await handleConnection();
+ return data.isStart;
+ }
+ );
const mainStore = useMainStore();
const config = mainStore.config;
@@ -908,6 +984,18 @@
const getArgs = async () => {
// console.error(config.proxyNetworks);
const args = [];
+ if (mainStore.enableCreateServer) {
+ if (config.relayAllPeerrpc) {
+ args.push("--relay-all-peer-rpc");
+ }
+ const whiteList = mainStore.ServerWhiteList.trim().split("\n").map(el => el.trim()).filter(el => el).join(" ");
+ if(whiteList && mainStore.enableWhiteList) {
+ args.push("--relay-network-whitelist", whiteList);
+ }if(!whiteList && mainStore.enableWhiteList) {
+ args.push("--relay-network-whitelist");
+ }
+ return args
+ }
if (mainStore.configStartEnable) {
if (mainStore.configPath) {
const isExists = await exists(mainStore.configPath, { baseDir: BaseDirectory.Resource });
@@ -1103,6 +1191,18 @@
importConfigData.data = "";
importConfigData.visible = true;
}
+ if (command === "create_server") {
+ mainStore.enableCreateServer = !mainStore.enableCreateServer;
+ if (mainStore.config.relayAllPeerrpc && !mainStore.enableCreateServer) {
+ try {
+ await ElMessageBox.confirm("是否关闭RPC流量转发?", "提示", {
+ confirmButtonText: "关闭",
+ cancelButtonText: "取消"
+ });
+ mainStore.config.relayAllPeerrpc = false;
+ } catch (err) {}
+ }
+ }
};
const handleStartImport = async () => {
@@ -1190,7 +1290,7 @@
logsTimer && clearInterval(logsTimer);
logsTimer = setInterval(() => {
appWindow.emitTo("log", "logs", data.log);
- }, 600);
+ }, 650);
},
() => {
data.logVisible = false;
diff --git a/pages/member.vue b/pages/member.vue
index e90119c..d8a4316 100644
--- a/pages/member.vue
+++ b/pages/member.vue
@@ -6,21 +6,25 @@
stripe
border
:data="data.member"
- v-else>
+ v-else
+ >
+ prop="hostname"
+ >
+ label="路由"
+ >
+ :type="row.cost == 'p2p' ? 'success' : 'info'"
+ >
{{ row.cost }}
@@ -29,17 +33,20 @@
sortable
width="120"
prop="ipv4"
- label="虚拟网IP">
+ label="虚拟网IP"
+ >
+ label="延迟/ms"
+ >
+ label="丢包率"
+ >
{{ row.loss_rate && row.loss_rate != "-" ? Number(row.loss_rate * 100).toFixed(2) + "%" : row.loss_rate }}
@@ -48,15 +55,23 @@
sortable
width="120"
label="nat_type"
- prop="NAT类型">
+ prop="NAT类型"
+ >
{{ natMaps[row.nat_type.toLowerCase() as natKyes] || row.nat_type || "-" }}
+ label="版本"
+ >
+
@@ -86,14 +101,14 @@
restricted: "nat2",
portrestricted: "nat3",
symmetric: "nat4",
- SymmetricEasyDec: "nat4-easydec",
- SymmetricEasyInc: "nat4-easyinc",
- SymUdpFirewall: "nat4-udpfirewall",
+ symmetriceasydec: "nat4-easydec",
+ symmetriceasyinc: "nat4-easyinc",
+ symUdpfirewall: "nat4-udpfirewall"
};
type natKyes = keyof typeof natMaps;
const data = reactive<{ member: any[] }>({
- member: [],
+ member: []
});
const _showTableHeader = [
@@ -104,12 +119,13 @@
["loss_rate", "丢包率"],
["nat_type", "NAT类型"],
["version", "版本"],
+ ["tunnel_proto", "隧道协议"]
];
const listenOutput = async () => {
const member = await invoke
("get_members_by_cli");
const peerInfo = parsePeerInfo(member);
- peerInfo.forEach((value) => {
+ peerInfo.forEach(value => {
if (value.cost === "Local") {
value.cost = "本机";
}
@@ -117,7 +133,7 @@
value.ipv4 = value.ipv4.split("/")[0];
}
});
- // console.error(peerInfo);
+ console.error(peerInfo);
data.member = peerInfo;
};
diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock
index e607235..26a950f 100644
--- a/src-tauri/Cargo.lock
+++ b/src-tauri/Cargo.lock
@@ -1176,7 +1176,7 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125"
[[package]]
name = "easytier-game"
-version = "1.2.4"
+version = "1.2.5"
dependencies = [
"log",
"planif",
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
index b2e0d20..d2f344c 100644
--- a/src-tauri/Cargo.toml
+++ b/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "easytier-game"
-version = "1.2.4"
+version = "1.2.5"
homepage = "https://github.com/EasyTier/EasyTier"
repository = "https://github.com/EasyTier/EasytierGame"
description = "A simple network initiator based on Easytier"
diff --git a/src-tauri/easytier/config/config_template.toml b/src-tauri/easytier/config/config_template.toml
new file mode 100644
index 0000000..477eba4
--- /dev/null
+++ b/src-tauri/easytier/config/config_template.toml
@@ -0,0 +1,77 @@
+# 实例名称,用于在同一台机器上标识此节点
+instance_name = ""
+# 主机名,用于标识此设备的主机名
+hostname = ""
+# 实例 ID,一般为 UUID,在同一个虚拟网络中唯一
+instance_id = ""
+# 此节点的虚拟网 IPv4 地址,如果为空,则此节点将仅转发数据包,不会创建 TUN 设备
+ipv4 = ""
+# 由 Easytier 自动确定并设置IP地址,默认从10.0.0.1开始。警告:在使用 DHCP 时,如果网络中出现 IP 冲突,IP 将自动更改
+dhcp = false
+
+# 监听器列表,用于接受连接
+listeners = [
+"tcp://0.0.0.0:11010",
+"udp://0.0.0.0:11010",
+"wg://0.0.0.0:11011",
+"ws://0.0.0.0:11011/",
+"wss://0.0.0.0:11012/",
+]
+
+# 退出节点列表
+exit_nodes = [
+]
+
+# 用于管理的 RPC 门户地址
+rpc_portal = "127.0.0.1:15888"
+
+[network_identity]
+# 网络名称,用于标识虚拟网络
+network_name = ""
+# 网络密钥,用于验证此节点属于虚拟网络
+network_secret = ""
+
+# 这里是对等连接节点配置,可以多段配置
+[[peer]]
+uri = "tcp://public.easytier.top:11010"
+
+[[peer]]
+uri = "udp://public.easytier.top:11010"
+
+# 这里是子网代理节点配置,可以有多段配置
+[[proxy_network]]
+cidr = "10.0.1.0/24"
+
+[[proxy_network]]
+cidr = "10.0.2.0/24"
+
+# WireGuard 配置信息
+[vpn_portal_config]
+# WireGuard 客户端所在的网段,下面为示例
+client_cidr = "10.14.14.0/24"
+#wg所监听的端口(请勿和listeners的wg冲突)
+wireguard_listen = "0.0.0.0:11012"
+
+[flags]
+# 连接到对等节点使用的默认协议
+default_protocol = "tcp"
+# TUN 设备名称,如果为空,则使用默认名称
+dev_name = ""
+# 禁用p2p
+disable_p2p = false
+# 是否启用加密
+enable_encryption = true
+# 是否启用 IPv6 支持
+enable_ipv6 = true
+# TUN 设备的 MTU
+mtu = 1380
+# 延迟优先模式,将尝试使用最低延迟路径转发流量,默认使用最短路径
+latency_first = false
+# 将本节点配置为退出节点
+enable_exit_node = false
+# 禁用 TUN 设备
+no_tun = false
+# 为子网代理启用 smoltcp 堆栈
+use_smoltcp = false
+# 仅转发白名单网络的流量,支持通配符字符串。多个网络名称间可以使用英文空格间隔。如果该参数为空,则禁用转发。默认允许所有网络。例如:'*'(所有网络),'def*'(以def为前缀的网络),'net1 net2'(只允许net1和net2)
+foreign_network_whitelist = "*"
\ No newline at end of file
diff --git a/src-tauri/easytier/config/test.toml b/src-tauri/easytier/config/test.toml
deleted file mode 100644
index 25c0f60..0000000
--- a/src-tauri/easytier/config/test.toml
+++ /dev/null
@@ -1,23 +0,0 @@
-hostname = "Test1"
-instance_name = "default"
-instance_id = "8803362c-e4f1-4df1-93e8-721653945f77"
-dhcp = true
-listeners = [
- "tcp://0.0.0.0:11010",
- "udp://0.0.0.0:11010",
- "wg://0.0.0.0:11011",
- "ws://0.0.0.0:11011/",
- "wss://0.0.0.0:11012/",
-]
-exit_nodes = []
-rpc_portal = "0.0.0.0:15888"
-
-[network_identity]
-network_name = "default"
-network_secret = ""
-
-[[peer]]
-uri = "tcp://public.easytier.top:11010"
-
-[[peer]]
-uri = "udp://public.easytier.top:11010"
\ No newline at end of file
diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json
index 483afb9..a152c56 100644
--- a/src-tauri/tauri.conf.json
+++ b/src-tauri/tauri.conf.json
@@ -1,7 +1,7 @@
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "easytier-game",
- "version": "1.2.4",
+ "version": "1.2.5",
"identifier": "com.tauri.easytier-game",
"build": {
@@ -13,7 +13,7 @@
"app": {
"windows": [
{
- "title": "easytier-game 1.2.4",
+ "title": "easytier-game 1.2.5",
"label": "main",
"minWidth": 340,
"width": 340,
diff --git a/stores/index.ts b/stores/index.ts
index b120311..b4554f8 100644
--- a/stores/index.ts
+++ b/stores/index.ts
@@ -14,7 +14,7 @@ export default defineStore("main", {
connectAfterStart: false, //软件打开后,是否自动连接
disableIpv6: false, // 是否禁用IPv6
disbleListenner: false, // 是否禁用监听
- disableEncryption: false, // 是否禁用加密
+ disableEncryption: true, // 是否禁用加密
multiThread: false, //使用多线程
enablExitNode: false, // 是否启用退出节点
noTun: false, // 是否使用TUN
@@ -39,6 +39,9 @@ export default defineStore("main", {
winIpBcAutoStart: true,
createConfigInEasytier: false, //在easytier目录生成config.json文件吗
githubFastUrl: "https://ghproxy.cc/",
+ enableCreateServer: false, // 自建服务器
+ enableWhiteList: true, // 是否启用白名单
+ ServerWhiteList: "", // 服务器流量转发白名单
winipBcPid: 0,
winipBcStart: false
@@ -82,7 +85,11 @@ export default defineStore("main", {
"configPath",
"winIpBcAutoStart",
"createConfigInEasytier",
- "githubFastUrl"
+ "githubFastUrl",
+
+ "enableCreateServer",
+ "enableWhiteList",
+ "ServerWhiteList"
],
// // 除了这些,其他都要存下来
// omit: ["winipBcPid", "winipBcStart"]