七年博客

在?看看批!
https://z.kkp.nz

Trojan一键脚本

Trojan-GFW作为一款新兴的代理软件,相比于L2TP,PPTP,OPENVPN等传统VPN以及SS,SSR,V2ray等主流代理软件,有着轻量化,配置简单,使用方便,速度更快等优势

Trojan必须要域名才能工作,推荐随便买个就行(实在没钱可以去注册一个TK的免费域名,不过现在不好注册了~)
地址:http://www.freenom.com/zh/index.html
然后域名解析到你VPS服务器IP地址上(Trojan不支持CDN 想套CF的同学可以洗洗睡了)
官方系统建议选择Debian Buster
CENTOS也没啥问题 一样可以装

安装依赖Debian

apt-get update && apt-get install whiptail sudo curl -y

安装依赖Centos

yum install newt sudo curl -y

中文版

sudo bash -c "$(curl -fsSL https://github.com/johnrosen1/trojan-gfw-script/raw/master/trojangui.sh)"

02.png
大致效果

英文版

sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/johnrosen1/trojan-gfw- 
script/master/trojan.sh)"

sudo bash -c "$(wget -O- https://raw.githubusercontent.com/johnrosen1/trojan-gfw- 
script/master/trojan.sh)"

客户端配置
桌面客户端(Windows)
(1)下载安装Microsoft Visual Studio 2015, 2017 and 2019(官方win release中已包含)

https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

重启后生效
从github下载预编译release并解压

https://github.com/trojan-gfw/trojan/releases
https://github.com/trojan-gfw/trojan/releases/download/v1.14.0/trojan-1.14.0-win.zip

打开config.json remote_addr填你的服务器的IP sni填你的服务器的域名 password记得要和服务器一样
Trojan-GFW客户端Config配置

{
"run_type": "client",
"local_addr": "127.0.0.1",
"local_port": 1080,
"remote_addr": "1.1.1.1", //你的服务器ip
"remote_port": 443,
"password": [
    "example" //你的密码,和服务器必须一致,password1或者2皆可
],
"log_level": 1,
"ssl": {
    "verify": true,
    "verify_hostname": true,
    "cert": "",
    "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:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:RSA-AES128-GCM-SHA256:RSA-AES256-GCM-SHA384:RSA-AES128-SHA:RSA-AES256-SHA:RSA-3DES-EDE-SHA",
    "cipher_tls13":"TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384",
    "sni": "yourdomain", //你的域名
    "alpn": [
        "h2",
        "http/1.1"
    ],
    "reuse_session": true,
    "session_ticket": true,
    "curves": ""
},
"tcp": {
    "no_delay": true,
    "keep_alive": true,
    "reuse_port": true,
    "fast_open": true,
    "fast_open_qlen": 20
    }
}

Trojan客户端仅支持socks5,因此得配合Chrome的Switchomeaga插件或者用V2ray把socks5转换成http使用

附:配合使用V2ray分流的json(可直接使用,无需修改)

{
"inbounds": [
    {
        "listen": "127.0.0.1",
        "port": 8001,
        "protocol": "http",
        "settings": {
             "timeout": 0,
             "allowTransparent": false,
             "userLevel": 0
                    },
        "sniffing": {
            "enabled": true,
            "destOverride": ["http","tls"]
        }
    }
],
"outbounds": [
{
  "tag": "proxy",
  "protocol": "socks",
  "settings": {
  "servers": [{
"address": "127.0.0.1",
"port": 1080
  }]
}
},
    {
  "tag": "direct",
  "protocol": "freedom",
  "settings": {},
  "streamSettings": {
    "sockopt": {
      "mark": 255
    }
  }
},
     {
     "tag": "adblock",
     "protocol" : "blackhole",
     "settings": {},
     "streamSettings": {
     "sockopt": {
       "mark": 255
       }
     }
  }
],
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
  {
    "type": "field",
    "inboundTag": ["dns-in"],
    "outboundTag": "dns-out"
  },
  {
    "type": "field",
    "outboundTag": "direct",
    "ip": ["geoip:private"]
  },
  {
    "type": "field",
    "outboundTag": "direct",
    "ip": ["geoip:cn"]
  },
  {
    "type": "field",
    "outboundTag": "direct",
    "domain": ["geosite:cn"]
  },
  {
     "type": "field",
     "outboundTag": "direct",
     "protocol": ["bittorrent"]
   }
 ]
},
"dns": {
"servers": [
  "8.8.4.4",
    {
       "address": "114.114.114.114",
       "port": 53,
       "domains": ["geosite:cn"]
   }
  ]
 }
}

https://chrome.google.com/webstore/detail/proxy-switchyomega/padekgcemlokbadohgkifijomclgjgif
下载安装完成后,点击新增情景模式,代理协议填入socks5 代理伺服器填 127.0.0.1 端口填 1080就可以了。

双击trojan.exe运行,如果闪退请安装 Microsoft Visual C++套件。若使用Chrome Switchomeaga,则选择代理服务器然后直接尝试访问google.com,理论上是可用了,如果不行,请自行检查ip可用性等问题。
01.png
注:Trojan本身仅支持全局代理,配合V2ray实现分流后可实现国内分流,代理Steam等功能,运行V2ray并设置系统代理为 http://127.0.0.1:8001 即可(win10在->开始菜单->设置->Proxy-> 127.0.0.1:8001即可,linux为 export https_proxy=http://127.0.0.1:8001之类的 )

本原创文章未经允许不得转载 | 当前页面:七年博客 » Trojan一键脚本

评论 6

  1. 浏览器插件等参考:https://kkp.nz/SOFT/240.html

    Admin 2020-01-04    回复
  2. 无法安装,提示找不到脚本文件。

    小虾米 2020-03-03    回复
  3. curl -O https://raw.githubusercontent.com/atrandys/trojan/master/trojan_centos7.sh && chmod +x trojan_centos7.sh && ./trojan_centos7.sh 试试这个

    Admin2020 2020-03-06    回复
    • 此脚本只支持centos,不支持debian。 有点尴尬了。

      小虾米 2020-03-06    回复
      • 原先的脚本还有吗?

        小虾米 2020-03-06    回复