chika0801 / sing-box-examples

sing-box 配置示例
https://github.com/SagerNet/sing-box
1.61k stars 270 forks source link

能否增加一个使用shadowssocks协议的链式代理示例? #113

Closed zwl1619 closed 1 month ago

zwl1619 commented 2 months ago

能否增加一个使用shadowssocks协议的链式代理示例? 比如,客户端在中国大陆,中转机在香港,落地机在美国,那么这三个角色的配置分别是怎样的?

chika0801 commented 1 month ago

中国大陆: 出站配置按它要求写

香港: 入站配置中用它的中转格式,记得是不需求在出站部分写的

美国: 入站部分是SS的入站

PS:你不一定非要这样组,因为这样组客户端(中国大陆)的配置就要配成SS TCP出站。

你在 香港 VPS上,利用路由规则把入站的比如是 xxx TCP TLS,转到对应出站tag,这个tag你写SS的配置到你美国就是了。

配置方式是灵活的,我平时用的思路就是类似于

https://github.com/chika0801/Xray-examples/tree/main/self-use

香港用的 xray_server_vps1.json

美国用的 xray_server_vps2.json

配置

chika0801 commented 1 month ago

我开始理解你问的是 https://sing-box.sagernet.org/configuration/inbound/shadowsocks/#structure 这种写法

Relay Structure

{
  "type": "shadowsocks",
  "method": "2022-blake3-aes-128-gcm",
  "password": "8JCsPssfgS8tiRwiMlhARg==",
  "destinations": [
    {
      "name": "test",
      "server": "example.com",
      "server_port": 8080,
      "password": "PCD2Z4o12bKUoFa3cC97Hw=="
    }
  ],
  "multiplex": {}
}

再看了眼你标题你问的是客户端用*ray系俗称的链式代理形式,我平时不用这种形式,我是在中转机路由规则中自己写的习惯

不管哪种方法目的都得行,看你自己习惯哪种。

zwl1619 commented 1 month ago

@chika0801 谢谢大佬。没找到sing-box怎么写,所以后来我用ubuntu自带的防火墙做中转转发了。