singbox服务端分流

查看 31|回复 2
作者:Aberson   
一直想搞分流,在ytb上搜了搜,简单易懂的都是基于xray,可我并不使用x,因为嫌弃它太占用内存。
于是开始找singbox教程,最终功夫不负有心人,成功搞定在singbox的服务端实现分流。
我使用的是233boy大佬的一键脚本,配置文件位置:/etc/sing-box/conf,我是基于入口来搞定的分流,singbox的配置config.json应该也可以,但我没尝试。
完整代码如下:
[ol]{
  "inbounds": [
    {
      "tag": "标签",
      "type": "shadowsocks",
      "listen": "::",
      "listen_port": 端口,
      "method": "加密方式",
      "password": "密码"
    }
  ],
  "outbounds": [
    {
      "type": "direct",
      "tag": "direct-out"
    },
    {
      "type": "shadowsocks",
      "tag": "proxy-chatgpt",
      "server": "IP地址",
      "server_port": 端口,
      "method": "加密方式",
      "password": "密码",
      "udp_over_tcp": false
    },
    {
      "type": "block",
      "tag": "block-out"
    }
  ],
  "route": {
    "rules": [
      {
        "domain_keyword": [
          "chatgpt",
          "openai"
        ],
        "outbound": "proxy-chatgpt"
      },
      {
        "geoip": [
          "private"
        ],
        "outbound": "direct-out"
      },
      {
        "geoip": [
          "cn"
        ],
        "outbound": "direct-out"
      },
      {
        "domain_suffix": [
          "cn"
        ],
        "outbound": "direct-out"
      }
    ],
    "final": "direct-out"
  }
}[/ol]复制代码
替换原来的json文件,而后重启singbox即可。
访问网址中包含chatgpt相关则走代理。
平日用自己的节点,当需要解锁chtgpt的时候走机场节点。
我也没什么需求,一般常用就是chatgpt,有其他奈飞或者ytb可以自己添加关键词。
最后不得不说一句,singbox真好用, 占用挺低,不满意的就是随着tcp、udp的连接内存会居高不下,我的解决办法是crontab 一小时重启一次singbox即可。

节点, 重启, 端口

willblue   
bg
HOH   
都是十几二十M的GO程序还嫌什么内存大,笑死人
您需要登录后才可以回帖 登录 | 立即注册

返回顶部