一键搭建Trojan-Go面板,Trojan-Go支持WebSocket,免费开启CDN隐藏自己VPS的真实IP,从而实现不被墙!

更新系统安装环境

更新系统

yum update -y  #CentOS
apt update -y  #Debian

Jrohy的一键Trojan面板脚本

#安装/更新
source <(curl -sL https://git.io/trojan-install)
#卸载
source <(curl -sL https://git.io/trojan-install) --remove

安装完后输入’trojan’可进入管理程序
浏览器访问 https://域名 可在线web页面管理trojan用户
前端页面源码地址: trojan-web

如图所示,Trojan 面板搭建完毕,按照提示网址登陆面板,并更改 Trojan 类型 为 Trojan-Go。

更改Trojan-Go配置文件

找到VPS目录文件 /usr/local/etc/trojan/config.json ,备份一份(若是把类型切换回来可以恢复使用Trojan)

下面是原本一键面板搭建完毕以后的配置文件,我们需要增加WS等其他Trojan-Go所支持的模块。

{
  "run_type": "server",
  "local_addr": "0.0.0.0",
  "local_port": 443,
  "remote_addr": "127.0.0.1",
  "remote_port": 80,
  "password": null,
  "log_level": 1,
  "ssl": {
    "cert": "/root/cert/cert.crt",
    "key": "/root/cert/private.key",
    "key_password": "",
    "cipher": "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384",
    "cipher_tls13": "TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384",
    "prefer_server_cipher": true,
    "alpn": ["http/1.1"],
    "alpn_port_override": {
      "h2": 81
    },
    "reuse_session": true,
    "session_ticket": false,
    "session_timeout": 600,
    "plain_http_response": "",
    "curves": "",
    "dhparam": "",
    "sni": "ora.trojango.xyz"
  },
  "tcp": {
    "prefer_ipv4": false,
    "no_delay": true,
    "keep_alive": true,
    "reuse_port": false,
    "fast_open": false,
    "fast_open_qlen": 20
  },
  "mysql": {
    "enabled": true,
    "server_addr": "127.0.0.1",
    "server_port": 40880,
    "database": "trojan",
    "username": "root",
    "password": "AIArx",
    "cafile": ""
  }
}

如下所示,请大家自行更改相应的参数。

  "mysql": {
    "enabled": true,
    "server_addr": "127.0.0.1",
    "server_port": 40880,
    "database": "trojan",
    "username": "root",
    "password": "AIArx",
    "cafile": ""
  },                              //这里增加一个英文的逗号
  "websocket":{
      "enabled": true,            //false为关闭
      "path": "/websocket",       //WS路径
      "host": "xxx.xxx.com"       //填写申请证书的域名
  },
  "mux": {                        //mux多路复用选项
      "enabled": true,            //false为关闭
      "concurrency": 8,           //单个TLS隧道可以承载的最大连接数,默认为8.这个数值越大,多连接并发时TLS由于握手产生的延迟就越低,但网络吞吐量可能会有所降低
      "idle_timeout": 60          //空闲超时时间。指TLS隧道在空闲多长时间之后关闭,单位为秒,如果数值为负值或0,则一旦TLS隧道空闲立即关闭
  }
}

Trojan-Go官方完整配置文件:点击访问

具体增加参数如下 (请务必看清楚上面的提示,一定记得有一个英文的逗号

    "websocket": {
        "enabled": true,
        "path": "/DFE4545DFDED/",
        "host": "你的域名"
    },
    "mux": {
        "enabled": true,
        "concurrency": 8,
        "idle_timeout": 60
    }

增加完成后保存并在面板重启Trojan-GO服务

转自:v2rayssr.com

发表评论