Skip to content

Instantly share code, notes, and snippets.

@woq
Created May 1, 2020 08:42
Show Gist options
  • Save woq/3ae2ab0c2f9b9758f0d13dbcbe50d81e to your computer and use it in GitHub Desktop.
Save woq/3ae2ab0c2f9b9758f0d13dbcbe50d81e to your computer and use it in GitHub Desktop.
trojan install & config

准备

  1. 一个域名
  2. SSL证书 推荐freessl.cn 亚洲诚信 1年单域名

安装

官方安装地址 wget -N --no-check-certificate -q -O trojan-quickstart.sh "https://raw.githubusercontent.com/trojan-gfw/trojan-quickstart/master/trojan-quickstart.sh" && chmod +x trojan-quickstart.sh && bash trojan-quickstart.sh

  • 配置
  1. local_port:监听的端口,默认是443,除非端口被墙,不建议改成其他端口;
  2. remote_addr和remote_port:非trojan协议时,将请求转发处理的地址和端口。可以是任意有效的ip/域名和端口号,默认是本机和80端口;
  3. password:密码。需要几个密码就填几行,最后一行结尾不能有逗号;
  4. cert和key:域名的证书和密钥,Let’s Encrypt申请的证书可用 certbot certificates 查看证书路径;
  5. key_password:默认没有密码(如果证书文件有密码就要填上);
  6. alpn:建议填两行:http/1.1和h2,保持默认也没有问题。
  • 启动 停止 配置 systemctl enable trojan``systemctl start trojan``ss -lp | grep trojan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment