From e77afc3264551118d838a7d99d9fe0e9005b4040 Mon Sep 17 00:00:00 2001 From: Kiritow <1362050620@qq.com> Date: Sun, 15 Aug 2021 09:07:03 +0000 Subject: [PATCH] Finished W2U LoadBalancer --- install.sh | 4 +++- install_cn.sh | 4 +++- tool_create.py | 2 +- tool_generate.py | 1 + w2u.c | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 840c008..ed2234d 100755 --- a/install.sh +++ b/install.sh @@ -2,7 +2,7 @@ set -xe sudo apt update -sudo apt install -y curl wireguard python3 tmux +sudo apt install -y curl wireguard python3 tmux build-essential mkdir -p local mkdir -p local/tunnel @@ -10,6 +10,8 @@ mkdir -p local/tunnel mkdir -p bin cd bin +gcc -O3 -o w2u ../w2u.c + curl -vL https://github.com/wangyu-/udp2raw-tunnel/releases/download/20200818.0/udp2raw_binaries.tar.gz -o udp2raw.tgz tar -xvzf udp2raw.tgz udp2raw_amd64 chmod +x udp2raw_amd64 diff --git a/install_cn.sh b/install_cn.sh index c0be488..191dd10 100755 --- a/install_cn.sh +++ b/install_cn.sh @@ -2,7 +2,7 @@ set -xe sudo apt update -sudo apt install -y curl wireguard python3 tmux +sudo apt install -y curl wireguard python3 tmux build-essential mkdir -p local mkdir -p local/tunnel @@ -10,6 +10,8 @@ mkdir -p local/tunnel mkdir -p bin cd bin +gcc -O3 -o w2u ../w2u.c + rm -rf wg-op-binary git clone https://gitee.com/kiritow/wg-op-binary cd wg-op-binary diff --git a/tool_create.py b/tool_create.py index 753846f..fb9338a 100644 --- a/tool_create.py +++ b/tool_create.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- import os import getpass -from tool_common import load_config, save_config, SimpleLogger, json_to_base64 +from tool_common import load_config, save_config, json_to_base64 config = load_config() diff --git a/tool_generate.py b/tool_generate.py index a941e5d..309ffb8 100644 --- a/tool_generate.py +++ b/tool_generate.py @@ -16,6 +16,7 @@ def write_tunnel_config(mode, listen_addr, remote_addr, password): -r {} -k {} --raw-mode faketcp +--fix-gro -a '''.format(mode, listen_addr, remote_addr, password)) return filename diff --git a/w2u.c b/w2u.c index af4d5c4..4ef9863 100644 --- a/w2u.c +++ b/w2u.c @@ -9,7 +9,7 @@ #include #include -// WireGuard ---> W2U --> Internet +// WireGuard ---> W2U --> udp2raw int main(int argc, char* argv[]) { int ret, flags;