ehco is a network relay tool and a typo :)
ehco is a network relay tool and a typo :)
本隧道和 django-sspanel深度对接,可以很方便的管理中转节点
使用隧道需要至少两台主机, 并且在两台主机上都安装了ehco
ehco的可执行文件可以从项目的release页面下载
直接在中转机器A上输入:
ehco -l 0.0.0.0:1234 -r 2.2.2.2:5555
该命令表示将所有从中转机器A的1234端口进入的流量直接转发到落地机器B的5555端口
用户即可通过 中转机器A的1234端口访问到落地机器B的5555端口的SS/v2ray服务了
在落地机器B上输入:
ehco -l 0.0.0.0:443 -lt mwss -r 127.0.0.1:5555
该命令表示将所有从落地机器B的443端口进入的wss流量解密后转发到落地机器B的5555端口
在中转机器A上输入:
ehco -l 0.0.0.0:1234 -r wss://2.2.2.2:443 -tt mwss
该命令表示将所有从A的1234端口进入的流量通过wss加密后转发到落地机器B的443端口
用户即可通过 中转机器A的1234端口访问到落地机器B的5555端口的SS/v2ray服务了
ehco支持从
配置文件/http接口里读取json格式的配置并启动
配置文件格式要求如下(更多例子可以参考项目里的
config.json文件):
{ "relay_configs": [ { "listen": "127.0.0.1:1234", // 监听端口 "listen_type": "raw", // 监听类型 "transport_type": "raw", // 传输类型 "tcp_remotes": [ // tcp转发节点 ,支持配置多个节点,配置多个节点时会自动负载均衡 "0.0.0.0:5201" ], "udp_remotes": [ "0.0.0.0:5201" // udp转发节点 ,支持配置多个节点,配置多个节点时会自动负载均衡 ] }, ] }
iperf:
# run iperf server on 5201 iperf3 -s直接转发
run relay server listen 1234 to 9001 (raw)
go run cmd/ehco/main.go -l 0.0.0.0:1234 -r 0.0.0.0:5201
直接转发END
通过ws隧道转发
listen 1234 relay over ws to 1236
go run cmd/ehco/main.go -l 0.0.0.0:1235 -r ws://0.0.0.0:1236 -tt ws
listen 1236 through ws relay to 5201
go run cmd/ehco/main.go -l 0.0.0.0:1236 -lt ws -r 0.0.0.0:5201
通过ws隧道转发END
通过wss隧道转发
listen 1234 relay over wss to 1236
go run cmd/ehco/main.go -l 0.0.0.0:1235 -r wss://0.0.0.0:1236 -tt wss
listen 1236 through wss relay to 5201
go run cmd/ehco/main.go -l 0.0.0.0:1236 -lt wss -r 0.0.0.0:5201
通过wss隧道转发END
通过mwss隧道转发 和wss相比 速度会慢,但是能减少延迟
listen 1237 relay over mwss to 1238
go run cmd/ehco/main.go -l 0.0.0.0:1237 -r wss://0.0.0.0:1238 -tt mwss
listen 1238 through mwss relay to 5201
go run cmd/ehco/main.go -l 0.0.0.0:1238 -lt mwss -r 0.0.0.0:5201
通过mwss隧道转发END
run through file
go run cmd/ehco/main.go -c config.json
benchmark tcp
iperf3 -c 0.0.0.0 -p 1234
benchmark tcp through wss
iperf3 -c 0.0.0.0 -p 1235
benchmark upd
iperf3 -c 0.0.0.0 -p 1234 -u -b 1G --length 1024
| iperf | raw | relay(raw) | relay(ws) |relay(wss) | relay(mwss)| | ---- | ---- | ---- | ---- | ---- | ---- | | tcp | 62.6 Gbits/sec | 23.9 Gbits/sec | 14.65 Gbits/sec | 4.22 Gbits/sec | 2.43 Gbits/sec | | udp | 2.2 Gbits/sec | 2.2 Gbits/sec | 直接转发 | 直接转发 | 直接转发 |