Code Monkey home page Code Monkey logo

wmproxy's Introduction

wmproxy

crates.io rustc 1.70.0 Released API docs

wmproxy已用Rust实现http/https代理, socks5代理, 反向代理, 负载均衡, 静态文件服务器,websocket代理,四层TCP/UDP转发,内网穿透等

📦 安装 & 🏃 使用

安装

cargo install wmproxy

OR

git clone https://github.com/tickbh/wmproxy
cd wmproxy
cargo install --path .
docker pull dreamwhat/wmproxy
docker run -p 8090:8090 --name proxy_bash dreamwhat/wmproxy /bin/./wmproxy proxy -b 0.0.0.0:8090

使用

默认端口为8090端口,默认监听地址为127.0.0.1

# 直接通用默认参数
wmproxy proxy

# 设置账号密码
wmproxy proxy -b 0.0.0.0:8090 --user wmproxy --pass wmproxy

# 其它指令
wmproxy --help

#配置文件版启动
wmproxy config -c config/client.toml
启动二级代理
  1. 在本地启动代理
wmproxy proxy -b 127.0.0.1:8090 -S 127.0.0.1:8091 --ts

或者

wmproxy config -c config/client.toml

配置文件如下:

[proxy]
# 连接服务端地址
#server = "127.0.0.1:8091"
bind_addr = "0.0.0.0:8090"
flag = "http https socks5"
# 连接服务端是否加密
ts = true
two_way_tls = true
# username = "wmproxy"
# password = "wmproxy"

# 内网映射配置的数组

  #将localhost的域名转发到本地的127.0.0.1:8080
[[proxy.mappings]]
name = "web"
mode = "http"
local_addr = "127.0.0.1:8080"
domain = "localhost"

headers = [
  "proxy x-forward-for {client_ip}",
  "proxy + from $url",
  "+ last-modified 'from proxy'",
  "- etag",
]

#将tcp的流量无条件转到127.0.0.1:8080
[[proxy.mappings]]
name = "tcp"
mode = "tcp"
local_addr = "127.0.0.1:8080"
domain = ""

因为纯转发,所以在当前节点设置账号密码没有意义-S表示连接到的二级代理地址,有该参数则表示是中转代理,否则是末端代理。--ts表示连接父级代理的时候需要用加密的方式链接

  1. 在远程启动代理
wmproxy proxy --user proxy --pass proxy -b 0.0.0.0:8091 --tc

或者

wmproxy config -c config/server.toml

配置文件如下:

[proxy]
#绑定的ip地址
bind_addr = "127.0.0.1:8091"

#代理支持的功能,1为http,2为https,4为socks5
# flag = "7"
username = "wmproxy"
password = "wmproxy"

#内网映射http绑定地址
map_http_bind = "127.0.0.1:8001"
#内网映射tcp绑定地址
map_tcp_bind = "127.0.0.1:8002"
#内网映射https绑定地址
map_https_bind = "127.0.0.1:8003"
#内网映射的公钥证书,为空则是默认证书
# map_cert = 
#内网映射的私钥证书,为空则是默认证书
# map_key =
# 双向认证
two_way_tls = true
#接收客户端是为是加密客户端
tc = true
#当前服务模式,server为服务端,client为客户端
mode = "server"

--tc表示接收子级代理的时候需要用加密的方式链接,可以--cert指定证书的公钥,--key指定证书的私钥,--domain指定证书的域名,如果不指定,则默认用自带的证书参数

至此通过代理访问的,我们已经没有办法得到真正的请求地址,只能得到代理发起的请求

代理间的认证

目前提供了两种认证双式, two_way_tls开启客户端的证书认证信息, 另一种服务端配置了usernamepassword即需要客户端配置相同的用户密码才能启用认证信息, 两种方式可叠加使用或者单独使用。 配置添加如下:

proxy:
  two_way_tls: true
  username: wmproxy
  password: wmproxy

🚥 路线图

socks5

  • IPV6 支持
  • SOCKS5 验证方式
    • NOAUTH
    • USERPASS
  • SOCKS5 Commands
    • CONNECT
    • UDP ASSOCIATE

http/https

  • IPV6 支持

内网穿透

  • Http 支持
  • Https 支持
  • Tcp 支持

反向代理

  • 静态文件服务器
  • 被动健康检查
  • 主动健康检查
  • 配置热加载
  • 负载均衡
  • 四层TCP负载
  • 四层UDP负载
  • 流量控制
  • websocket转发

基础能力

  • 日志

扩展能力

  • 请求限速(limit_req)
  • 修改 HTTP 请求 Header
  • 支持 HTTP2 的内网穿透
  • 控制微端
  • try_paths
  • tcp转websocket
  • websocket转tcp

Star History

Star History Chart

wmproxy's People

Contributors

louis-zhou avatar tickbh avatar w273732573 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wmproxy's Issues

ovpn

Hello, can you improve the documentation a little, I am currently using this tunnel with openvpn on my client I have this configuration.

[proxy]
server="216.189.154.18:80"
bind_addr = "127.0.0.1:8090"

mode="client"

but it doesn't work, but if I do it from the console arguments it works.
this way

./wmproxy.exe -b 127.0.0.1:8090 -S 216.189.154.18:80

From ovpn I use -b 127.0.0.1:8090 as a proxy and achieve a connection.

How can I add or change in TCP and UDP as well as in client and server

and add headers in client

I would like you to expand the document better.

I do -h but it doesn't explain much

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.