wsproxy

command module
v0.0.0-...-dccbea2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2020 License: LGPL-2.1 Imports: 6 Imported by: 0

README

## 一个支持websocket级联的socks5/http复合代理.

支持在同一个端口同时提供websocket、socks5、http代理服务, 支持通过websocket级联代理.

                 +-------------------+          |         +-------------------+
  browser/app -> | socks5/http proxy | -> wss --|-- wss ->|  sock/http proxy  |--> target
                 +-------------------+          |         +-------------------+
                     local server              Wall           remote server

或多级代理, 如:

                 +-------------------+     +-------------------+        +-------------------+
  browser/app -> | socks5/http proxy | --> | sock/http proxy   |------> | socks5/http proxy |--> target
                 +-------------------+ wss +-------------------+ socks  +-------------------+
                     local server               remote server              remote server

也可实现多线路负载均衡代理, 如:

                                                  +-------------------+
                                               +--|  sock/http proxy  |\
                                               |  +-------------------+
                                               |
                 +-------------------+         |  +-------------------+
  browser/app -> | socks5/http proxy | --> wss +->|  sock/http proxy  |-- target
                 +-------------------+         |  +-------------------+
                     local server              |
                                               |  +-------------------+
                                               +--|  sock/http proxy  |/
                                                  +-------------------+

                                                    remote servers

编译

安装golang/git环境后, 在项目目录执行以下命令编译

go build

即可完成编译,编译生成可执行程序, (注意, 上图中local server和remote server是同一个程序).

另外,remote server 可以配置多个以用于负载均衡,具体参考config.json.example文件.

说明

证书文件必须位于程序运行目录的 .wsproxy/certs 下, 统一通过ca.crt签名出server和client证书. 证书创建可以参考网上教程,如 https://openvpn.net/community-resources/setting-up-your-own-certificate-authority-ca/

remote server端用到 ca.crt server.crt server.key

local server端用到 ca.crt client.crt client.key

config.json 可参看 config.json.example 文件中的说明, 编写的config.json并放置于可执行程序同一目录.

相关讨论群 https://t.me/joinchat/C3WytT4RMvJ4lqxiJiIVhg

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL