Code Monkey home page Code Monkey logo

ehco's Introduction

ehco

Go Report Card go.dev reference

ehco is a network relay tool and a typo :)

视频安装教程

  • 面板视频安装教程: 地址

  • 后端对接视频教程: 地址

  • 隧道对接视频教程: 地址

主要功能

  • tcp/udp relay
  • tcp/(udp暂时不支持) relay over wss
  • 从配置文件启动 支持多端口转发
  • 从远程启动
  • benchmark

TODO

  • 热重载配置

使用说明

使用隧道需要至少两条主机,并且在两台主机上都安装了ehco

ehco的可执行文件可以从项目的release页面下载

  • 中转机器 A 假设机器A的IP是 1.1.1.1
  • 落地机器 B 假设机器B的IP是 2.2.2.2 并且落地机器B的5555端口跑着一个SS/v2ray服务

案例一 不用隧道直接通过中转机器中转用户流量

直接在中转机器A上输入: ehco -l 0.0.0.0:1234 -r 2.2.2.2:5555

该命令表示将所有从中转机器A的1234端口进入的流量直接转发到落地机器B的5555端口

用户即可通过 中转机器A的1234端口访问到落地机器B的5555端口的SS/v2ray服务了

案例二 用mwss隧道中转用户流量

在落地机器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服务了

Benchmark

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


# 通过wss隧道转发
# listen 1234 relay over ws to 1236
go run cmd/ehco/main.go -l 0.0.0.0:1235  -r wss://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 wss -r 0.0.0.0:5201
# 通过wss隧道转发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 暂不支持 暂不支持 暂不支持

ehco's People

Contributors

dongxinb avatar ehco1996 avatar sljeff avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.