0%

2023-03-04-17-34-36

centos 安装 trojan记录

  1. 从shadowsock上复制配置
    点击齿轮图标 icon-config.png 打开单节点的配置窗口,点击 复制配置 即可复制节点配置
    ssl 的 verfiy 改为 false,我觉得应该不用改,可以验证一下

  2. 启动后我以为就是设置http_proxy为127.0.0.1:1080
    其实不是,1080是socks5的,要再下载一个privoxy

    1
    2
    yum install -y privoxy

  3. 改privoxy配置

    1
    2
    3
    4
    vim /etc/privoxy/config
    # 末尾增加下面内容,/后面是代理服务器的地址:端口,注意最后还有个.

    forward-socks5t / 127.0.0.1:1080 .
  4. 启动privoxy

    1
    systemctl start privoxy
  5. 设置http_proxy

    1
    2
    3
    export https_proxy=http://127.0.0.1:8118
    export http_proxy=http://127.0.0.1:8118
    export all_proxy=http://127.0.0.1:8118
  6. 这时再去访问openai网站

    1
    2
    3
    4
    5
    6
    7
    8
    curl https://api.openai.com/v1/chat/completions \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer YOUR_API_KEY' \
    -d '{
    "model": "gpt-3.5-turbo",
    "messages": [{"role": "user", "content": "Hello!"}]
    }'

  7. 参考
    Centos7 客户端使用Trojan代理配置