这真是个神奇的隧道

配置

服务端

/etc/systemd/system/wstunnel.service

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[Unit]
Description=wstunnel
After=network-online.target

[Service]
Type=simple
User=root
Restart=on-failure
RestartSec=5s
DynamicUser=true
ExecStart=wstunnel server --restrict-http-upgrade-path-prefix tunnel wss://[::]:28170

[Install]
WantedBy=multi-user.target

客户端

1
wstunnel client --http-upgrade-path-prefix tunnel -L 'udp://0.0.0.0:28170:127.0.0.1:28170?timeout_sec=0' -L 'tcp://0.0.0.0:28171:127.0.0.1:28171?timeout_sec=0' wss://[server_ip]:28170