一个快速、轻量级的Proxy
使用Golang编写的一个简单的Proxy,采用CS结构,速度还不错,这是我写的第一个Golang程序,如有错漏迎提Iusse指出,也欢迎提交PR
- Golang 1.8.x
# clone 项目
git clone https://github.com/rongself/simple-proxy.git
# 编译项目
cd simple-proxy && ./install.sh执行成功之后会在项目根目录和./bin文件夹下生成以下文件
./
├── bin
│ ├── client // 客户端可执行文件
│ └── server // 服务器端可执行文件
├── config
│ ├── client.config.json // 客户端配置文件
│ └── server.config.json // 服务器端配置文件
编辑配置文件 ./config/server.config.json
{
"server":"0.0.0.0", //服务器监听IP,一般设为 0.0.0.0
"server_port":8888, //服务器监听端口
"compress":"flate", //流量压缩,目前支持"flate"
"password":"barfoo!", //* 密码,此项暂时还没有实现
"method": "bitcrypt", //* 加密方式,此项暂时还没有实现,默认使用位运加密
"timeout":60 //* 连接超时时间,此项暂时还没有实现
}
编辑配置文件 ./config/client.config.json
{
"server":"yourserver.com", //服务器监听IP,一般设为 0.0.0.0
"server_port":8888, //服务器监听端口
"local":"0.0.0.0", //本地监听IP,设为127.0.0.1只允许本地连接,为0.0.0.0允许局域网链接
"local_port":1070, //本地监听端口,浏览器代理设置此端口
"compress":"flate", //流量压缩,目前支持"flate"
"password":"barfoo!", //* 密码,此项暂时还没有实现
"method": "bitcrypt", //* 加密方式,此项暂时还没有实现,默认使用位运加密
"timeout":60 //* 连接超时时间,此项暂时还没有实现
}
运行可执行文件
- 在外网服务器运行服务器端:
./bin/server- 在本地运行客户端
./bin/client设浏览器代理为客户端配置中配置的地址[本地IP|局域网IP]:local_port,上面配置即为 127.0.0.1:1070