ubuntu下载安装#
sudo apt update
wget https://github.com/trojan-gfw/trojan/releases/download/v1.16.0/trojan-1.16.0-linux-amd64.tar.xz
tar -xf trojan-1.16.0-linux-amd64.tar.xz
sudo mv trojan/trojan /usr/local/bin/
sudo mkdir -p /etc/trojan/
sudo vi /etc/trojan/config.json
### 配置内容参考如下
配置修改#
- run_type: client
- local_addr: 本地地址建议 0.0.0.0
- local_port: 本地端口 1080(这个随意设置)
- remote_addr:远程服务器地址
- remote_port:代理服务器端口
- password: 代理服务器访问密码
- sni: 主机sni名称
- 以上注意针对性修改 其它可以不用修改 下面是demo
{
"run_type": "client",
"local_addr": "0.0.0.0",
"local_port": 1080,
"remote_addr": "代理服务器地址",
"remote_port": 443,
"password": [
"此处配置密码"
],
"ssl": {
"verify": true,
"verify_hostname": true,
"cert": "",
"cipher": "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256",
"cipher_tls13": "TLS_AES_128_GCM_SHA256",
"sni": "此处配置主机sni名称",
"alpn": [
"h2",
"http/1.1"
],
"reuse_session": true,
"session_ticket": false,
"curves": "",
"prefer_server_cipher": false
},
"tcp": {
"no_delay": true,
"keep_alive": true,
"fast_open": false,
"fast_open_qlen": 20
}
}
创建systemd服务#
sudo vi /etc/systemd/system/trojan.service
## 以下为内容
[Unit]
Description=Trojan Service
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/trojan -c /etc/trojan/config.json
Restart=on-failure
[Install]
WantedBy=multi-user.target
重新加载 systemd
服务并启动 Trojan#
sudo systemctl daemon-reload
sudo systemctl start trojan
sudo systemctl enable trojan
##检查状态
sudo systemctl status trojan
## 重新启动
sudo systemctl restart trojan
chrome安装SwitchyOmega#
https://chromewebstore.google.com/detail/proxy-switchyomega/padekgcemlokbadohgkifijomclgjgif
https://github.com/FelisCatus/SwitchyOmega/releases
配置SwitchyOmega#
- 在选项中设置prxoy里代理协议SOCKS5,代理服务器:127.0.0.1,端口1080(即浏览器连接本地)
然后选中这一项(proxy)即可
- 流量不够用的注意使用完毕停止就好
...