Skip to content

创建SS转发已实现SS -> Trojan

为什么要多此一举。因为我的梅林固件的华硕路由器只支持SS和V2Ray – 所以只好人为的创建一个转发。

总体思路是:

  1. 服务器A建立Trojan Server端服务
  2. 还是在A上建立Trojan Client,开启Socks5服务
  3. 用Glider创建本地SS到本地Socks5的转发 (因为Glider不支持直接到Trojan服务的转发)

Step 1 – 参考这里

Step 2 – 建立本地的Trojan Client连接

把Step1生成的Conf文件做一个修改,大概长这样

其中ssl – verify一定要改称 false – 不然会出现certificate check error.

{
    "run_type": "client",
    "local_addr": "127.0.0.1",
    "local_port": 1080,
    "remote_addr": "127.0.0.1",
    "remote_port": 443,
    "password": [
        "password"
    ],
    "log_level": 1,
    "ssl": {
        "verify": false, # 就是这里
        "verify_hostname": true,
        "cert": "",
        "cipher": "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:AES128-SHA:AES256-SHA:DES-CBC3-SHA",
        "cipher_tls13": "TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384",
        "sni": "",
        "alpn": [
            "h2",
            "http/1.1"
        ],
        "reuse_session": true,
        "session_ticket": false,
        "curves": ""
    },
    "tcp": {
        "no_delay": true,
        "keep_alive": true,
        "reuse_port": false,
        "fast_open": false,
        "fast_open_qlen": 20
    }
}

执行 –

nohup /usr/src/trojan/trojan -c /usr/src/trojan/client.conf >> /tmp/trojan_client.log 2>&1 &

也可以设置开机自启 – vi /etc/rc.local

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

nohup /usr/src/trojan/trojan -c /usr/src/trojan/client.conf >> /tmp/trojan_client.log 2>&1 &
exit 0

Step 3 – Glider

# 下载
git clone https://github.com/ooxoop/glider-install
# 执行
cd glider-install && bash ./glider.sh

配置转发

verbose=True
# 直接命令行就写成这样
# ./glider -listen ss://aes-256-cfb:password@:20605 -forward socks5://127.0.0.1:1080
listen=ss://aes-256-cfb:password@:20605
forward=socks5://127.0.0.1:1080

Leave a Reply

Your email address will not be published.