静看光阴荏苒
不管不顾不问不说也不念

配置overplus代理

overplus目前兼容trojan协议,也就是说只要你用的客户端支持trojan协议就可以连接到overplus服务器,例如v2rayn、v2raya、shadowrocket都是可以的。不过overplus的作者后续的打算应该是重新设计一个新的协议来替代trojan协议。

overplus有预编译好的二进制文件可用,但我看到作者最近提交的更改很多,所以决定自己编译一个存储库里面最新的版本。首先安装编译需要用到的包:

apt -y update
apt -y install build-essential libboost-all-dev libssl-dev cmake git

获取项目文件并编译:

git clone https://github.com/xyanrch/overplus.git
cd overplus && mkdir build && cd build
cmake ..
make

复制编译好的文件:

cp overplus /usr/local/bin/overplus

新建一个目录用于存放overplus的配置文件:

mkdir -p /usr/local/etc/overplus

新建overplus的配置文件:

nano /usr/local/etc/overplus/server.json

一个示例配置如下:

{
    "run_type": "server",
    "local_addr": "0.0.0.0",
    "local_port": "443",
    "allowed_passwords": [
        "password"
    ],
    "log_level": "NOTICE",
    "log_dir":"",
    "ssl": {
        "cert": "/etc/letsencrypt/live/overplus.example.com/fullchain.pem",
        "key": "/etc/letsencrypt/live/overplus.example.com/privkey.pem"
    }
}

注:如果你的服务器443端口被占用了,在这里你也可以选择用其他的端口,例如8443。

接下来需要申请一个ssl证书,这里我使用certbot+nginx来完成,首先安装一下相关的包:

apt -y install nginx python3-certbot-nginx

新建一个nginx站点配置文件:

nano /etc/nginx/conf.d/overplus.conf

写入如下配置:

server {
        listen 80;
        server_name overplus.example.com;
}

接下来就可以使用certbot申请ssl证书了:

certbot certonly --nginx

你申请好的证书和私钥的路径应该就是之前server.json里面配置的路径:

/etc/letsencrypt/live/overplus.example.com/fullchain.pem
/etc/letsencrypt/live/overplus.example.com/privkey.pem

你只需将overplus.example.com这个域名替换成你自己的域名即可。

接下来新建一个systemd服务:

nano /etc/systemd/system/overplus.service

写入如下配置:

[Unit]
Description=overplus - An proxy tool helps you bypass GFW
After=network.target

[Service]
ExecStart=/usr/local/bin/overplus /usr/local/etc/overplus/server.json
Restart=on-failure
RestartSec=10s
LimitNOFILE=infinity

[Install]
WantedBy=multi-user.target

启动overplus并设置开机自启:

systemctl enable --now overplus

检查运行状态:

systemctl status overplus

只需要确保正在运行即可,日志里面可能有很多关于TLS握手的错误信息直接忽略掉即可,这个不影响正常使用:

客户端可以使用overplus或者其他的软件,这里截一个v2rayn的配置图供参考:

赞(5)
未经允许不得转载:荒岛 » 配置overplus代理
分享到: 更多 (0)

评论 2

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #1

    :oops: 膜膜

    句句子1年前 (2022-10-24) Google Chrome 104.0.5172.179 Google Chrome 104.0.5172.179 Windows 10 x64 Edition Windows 10 x64 Edition回复

分享创造快乐

广告合作资源投稿