Menu Close

Trojan Plus 一键脚本 – trojan plus多server链路聚合简单轮询负载均衡增加带宽教程,管道模式配置

Trojan Plus一键脚本,Trojan Plus新增加的管道模式(pipeline)可以节省TCP TLS握手时间,加载速度更快,同时支持多server负载均衡,增加带宽,非常值得一试。基本跑通了负载均衡模式,但对于效果及配置的合理性,博主还是属于吃螃蟹中,欢迎交流指正。

1、trojan plus服务端安装教程(一键脚本)

  • 这里博主编译了amd64和win64版本的trojan plus,在可以查看文章最后的二进制文件。
  • 一键脚本安装直接调用编译好的可执行文件,并非拉源码编译。
  • 一键脚本只是服务端安装,如需要启用trojan plus多server负载均衡,只需要在客户端配置即可,多个server服务端都可使用此脚本搭建。
  • 需要一个域名,建议用二级域名,脚本自动申请https证书。
  • 自动配置伪装站。
  • 转载本文需获取授权,转载请著明文章链接。
  • 注意目前脚本在ubuntu20.04系统下测试正常使用,centos7涉及到glibc和c++库版本低的问题,debian未测试,建议使用ubuntu20.04测试

(1)ssh连接VPS,执行以下命令

bash <(curl -Ls https://raw.githubusercontent.com/atrandys/trojan-plus/main/install.sh)

(2)选择1安装trojan plus

(3)输入解析到此服务器的域名,例如www.atrandys.com,不能带https或https

(4)安装过程中设置trojan的密码,建议英文+数字,不要出现特殊字符(未作特殊字符的处理)

(5)安装完成后可获得客户端的配置文件。

2、trojan plus客户端使用教程(win)

(1)下载trojan.exe文件,https://github.com/atrandys/trojan-plus/releases

(2)将服务端安装完成后获取的客户端配置文件命名为config.json并放在trojan.exe同一目录下。

(3)新建start.bat,内容如下:

@ECHO OFF
%1 start mshta vbscript:createobject("wscript.shell").run("""%~0"" ::",0)(window.close)&&exit
start /b trojan.exe

(4)双击start.bat即可启动trojan,请配合浏览器插件swithyomega使用。

3、trojan plus客户端负载均衡配置(win)

我们以2个server负载均衡为例,server1客户端配置文件为s1.json,server2客户端配置文件为s2.json,s1和s2的trojan密码需要相同,s1和s2的本地端口不能相同,且不能和后面的config.json相同。

(1)下载trojan.exe文件,https://github.com/atrandys/trojan-plus/releases

(2)将获取的两个客户端配置文件和trojan.exe放置于同一目录,即trojan.exe和s1.json和s2.json位于同一目录下

(3)新建配置文件config.json,内容如下:

{
"run_type": "client",
"local_addr": "127.0.0.1",
"local_port": 2080,
"password": [
"你的trojan密码"
],
"log_level": 1,
"experimental":{
"pipeline_num" : 2,
"pipeline_ack_window" : 200,
"pipeline_loadbalance_configs" : [
"s1.json",
"s2.json"
]
}
}

(4)新建start.bat,内容如下


@ECHO OFF
%1 start mshta vbscript:createobject("wscript.shell").run("""%~0"" ::",0)(window.close)&&exit
start /b trojan.exe -c s1.json
start /b trojan.exe -c s2.json
start /b trojan.exe

(5)运行start.bat开启负载均衡模式

4、二进制文件

Trojan plus官方未提供编译二进制文件,博主编译了amd64和win64版,一键脚本中也是使用此已编译的执行文件,https://github.com/atrandys/trojan-plus/releases

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注