Total Pageviews

Thursday 23 November 2023

sing-box

The universal proxy platform.

sing-box.sagernet.org

Packaging status

Documentation

https://sing-box.sagernet.org

Support

https://community.sagernet.org/c/sing-box/

from https://github.com/SagerNet/sing-box

--------------------------------------------------------------------------------

quic-go API wrapper and QUIC based protocol implementations  .

sing-quic

from https://github.com/SagerNet/sing-quic

------------------------------------------------------

 

https://www.youtube.com/watch?v=o-IFEu4GENE

---------------------------------------------------------------------------------------------

https://sing-box.sagernet.org/installation/package-manager/#managed-installation

https://sing-box.sagernet.org/installation/build-from-source/

-------------------------------------------------------------------------------------------------

Sing-box 全家桶 --- 一键多协议脚本  

Sing-box 全家桶】

目录

更新信息

2023.11.21 v1.1.1 1. XTLS + REALITY remove flow: xtls-reality-vision to support multiplexing and TCP brutal (requires reinstallation); 2. Clash meta add multiplexing parameter. 1. XTLS + REALITY 去掉 xtls-reality-vision 流控以支持多路复用和 TCP brutal (需要重新安装); 2. Clash meta 增加多路复用参数

2023.11.17 v1.1.0 1. Add [ H2 + Reality ] and [ gRPC + Reality ]. Reinstall is required; 2. Use beta verion instead of alpha; 3. Support TCP brutal and add the official install script; 1. 增加 [ H2 + Reality ] 和 [ gRPC + Reality ],需要重新安装; 2. 由于 Sing-box 更新极快,将使用 beta 版本替代 alpha 3. 支持 TCP brutal,并提供官方安装脚本

2023.11.15 v1.0.1 1. Support TCP brutal. Reinstall is required; 2. Use alpha verion instead of latest; 3. Change the default CDN to [ cn.azhz.eu.org ]; 1. 支持 TCP brutal,需要重新安装; 2. 由于 Sing-box 更新极快,将使用 alpha 版本替代 latest; 3. 默认优选改为 [ cn.azhz.eu.org ]

2023.10.29 v1.0 正式版 1. Sing-box Family bucket v1.0; 2. After installing, add [sb] shortcut; 3. Output the configuration for Sing-box Client; 1. Sing-box 全家桶 v1.0; 2. 安装后,增加 [sb] 的快捷运行方式; 3. 输出 Sing-box Client 配置

历史更新 history(点击即可展开或收起)

项目特点:

  • 一键部署多协议,可以单选、多选或全选 ShadowTLS v3 / XTLS Reality / Hysteria2 / Tuic V5 / ShadowSocks / Trojan / Vmess + ws / Vless + ws + tls / H2 Reality / gRPC Reality, 总有一款适合你
  • 节点信息输出到 V2rayN / Clash Meta / 小火箭 / Nekobox / Sing-box
  • 自定义端口,适合有限开放端口的 nat 小鸡
  • 内置 warp 链式代理解锁 chatGPT
  • 不需要域名 ( vmess / vless 方案例外)
  • 智能判断操作系统: Ubuntu 、Debian 、CentOS 、Alpine 和 Arch Linux,请务必选择 LTS 系统
  • 支持硬件结构类型: AMD 和 ARM,支持 IPv4 和 IPv6

Sing-box for VPS 运行脚本:

bash <(wget -qO- https://raw.githubusercontent.com/fscarmen/sing-box/main/sing-box.sh)
Option 参数 Remark 备注
-c Chinese 中文
-e English 英文
-u Uninstall 卸载
-n Export Nodes list 显示节点信息
-p Change the nodes start port 更改节点的起始端口
-o Stop / Start the Sing-box service 停止/开启 Sing-box 服务
-v Sync Argo Xray to the newest 同步 Argo Xray 到最新版本
-b Upgrade kernel, turn on BBR, change Linux system 升级内核、安装BBR、DD脚本
-r Add and remove protocols 添加和删除协议

Vmess / Vless 方案设置任意端口回源以使用 cdn

举例子 IPv6: vmess [2a01:4f8:272:3ae6:100b:ee7a:ad2f:1]:10006 image

  1. 解析域名
image
  1. 设置 Origin rule
image

Nekobox 设置 shadowTLS 方法

  1. 复制脚本输出的两个 Neko links 进去
image
  1. 设置链式代理,并启用 右键 -> 手动输入配置 -> 类型选择为 "链式代理"。

点击 "选择配置" 后,给节点起个名字,先后选 1-tls-not-use 和 2-ss-not-use,按 enter 或 双击 使用这个服务器。一定要注意顺序不能反了,逻辑为 ShadowTLS -> ShadowSocks。

image

主体目录文件及说明

/etc/sing-box/                               # 项目主体目录
|-- cert                                     # 存放证书文件目录
|   |-- cert.pem                             # SSL/TLS 安全证书文件
|   `-- private.key                          # SSL/TLS 证书的私钥信息
|-- conf                                     # sing-box server 配置文件目录
|   |-- 00_log.json                          # 日志配置文件
|   |-- 01_outbounds.json                    # 服务端出站配置文件,已加了 warp 账户信息
|   |-- 02_route.json                        # 路由配置文件,chatGPT 使用 warp ipv6 链式代理出站
|   |-- 11_SHADOWTLS_inbounds.json           # ShadowTLS 协议配置文件
|   |-- 12_REALITY_inbounds.json             # Reality 协议配置文件
|   |-- 13_HYSTERIA2_inbounds.json           # Hysteria2 协议配置文件
|   |-- 14_TUIC_inbounds.json                # Tuic V5 协议配置文件
|   |-- 15_SHADOWSOCKS_inbounds.json         # Shadowsocks 协议配置文件
|   |-- 16_TROJAN_inbounds.json              # Trojan 协议配置文件
|   |-- 17_VMESS_WS_inbounds.json            # vmess + ws 协议配置文件
|   `-- 18_VLESS_WS_inbounds.json            # vless + ws + tls 协议配置文件
|-- logs
|   `-- box.log                              # sing-box 运行日志文件
|-- geosite.db                               # 用于基于域名或网站分类来进行访问控制、内容过滤或安全策略
|-- geoip.db                                 # 用于根据 IP 地址来进行地理位置策略或访问控制
|-- language                                 # 存放脚本语言文件,E 为英文,C 为中文
|-- list                                     # 节点信息列表
|-- sing-box                                 # sing-box 主程序
`-- sb.sh                                    # 快捷方式脚本文件

鸣谢下列作者的文章和项目:

千歌 sing-box 模板: https://github.com/chika0801/sing-box-examples
瞎折腾 sing-box 模板: https://t.me/ztvps/37

from https://github.com/fscarmen/sing-box 

-------------------------------------------------------

Experimental iOS/macOS client for sing-box。

sing-box-for-apple

Experimental iOS/macOS/tvOS client for sing-box, the universal proxy platform.

Documentation

SFI | SFM

from https://github.com/SagerNet/sing-box-for-apple

----------------------------------------------------------------

Experimental Android client for sing-box  。

SFA

Experimental Android client for sing-box, the universal proxy platform.

Documentation

https://sing-box.sagernet.org/installation/clients/sfa/

from https://github.com/SagerNet/sing-box-for-android 

--------------------------------------------------------------

https://sagernet.org/

----------------------------

sing-box 配置示例.

TCP Brutal 使用指南

Brutal 这是 Hysteria 自有的拥塞控制算法。与 BBR 不同,Brutal 采用固定速率模型,丢包或 RTT 变化不会降低速度。相反,如果无法达到预定的目标速率,反而会根据计算的丢包率提高发送速率来进行补偿。Brutal 只在你知道(并正确设置了)当前网络的最大速度时才能正常运行。其擅长在拥塞的网络中抢占带宽,因此得名。

Brutal 如果带宽设置低于实际最大值也能正常运行;相当于限速。重要的是不要将其设置得高于实际最大值,否则会因为补偿机制导致连接速度慢、不稳定,且浪费流量。

Hysteria 是多倍发包吗?

My response to the recent controversy about TCP Brutal

服务端安装 TCP Brutal

安装脚本:

bash <(curl -fsSL https://tcp.hy2.sh/)

需要内核版本 4.9 或以上,推荐使用 5.8 以上的内核。对于小于 5.8 的内核, 只支持 IPv4。

客户端配置

            "multiplex": {
                "enabled": true,
                "protocol": "h2mux", // 默认 h2mux,可选 smux | yamux | h2mux
                "max_connections": 1, // 建议为 1
                "min_streams": 4,
                "padding": false, // 默认 false,可选 false | true
                "brutal": {
                    "enabled": true,
                    "up_mbps": 20,
                    "down_mbps": 100
                }
            }

需要 sing-box 版本 1.7.0 或更高。

支持的:ShadowTLS | Shadowsocks | Trojan | VLESS | VLESS-REALITY | VMess-HTTPUpgrade-TLS | VMess-WebSocket-TLS | VMess-WebSocket | VMess

  1. VLESS / VLESS-REALITY"flow": "" 必须留空

  2. 两端 "padding" 必须一致

  3. "up_mbps" / "down_mbps" 必填,不会生效

示例配置

服务端配置

            "multiplex": {
                "enabled": true,
                "padding": false,
                "brutal": {
                    "enabled": true,
                    "up_mbps": 100, // 客户端的下行速率
                    "down_mbps": 20
                }
            }

需要 sing-box 版本 1.7.0 或更高。
建议 "up_mbps" 填小一些,量力而行,不会有错

支持的:ShadowTLS | Shadowsocks | Trojan | VLESS | VLESS-REALITY | VMess-HTTPUpgrade-TLS | VMess-WebSocket-TLS | VMess-WebSocket | VMess

  1. VLESS / VLESS-REALITY"flow": "" 必须留空

  2. 两端 "padding" 必须一致

  3. "up_mbps" / "down_mbps" 必填,"down_mbps" 不会生效

示例配置

sing-box 安装指南

一键脚本 sing-box-install

安装正式版

bash -c "$(curl -L https://sing-box.vercel.app)" @ install

安装预发布版

bash -c "$(curl -L https://sing-box.vercel.app)" @ install --beta

编译安装最新版

bash -c "$(curl -L https://sing-box.vercel.app)" @ install --go

卸载

bash -c "$(curl -L https://sing-box.vercel.app)" @ remove
项目
程序 /usr/local/bin/sing-box
配置 /usr/local/etc/sing-box/config.json
geoip /usr/local/share/sing-box/geoip.db
geosite /usr/local/share/sing-box/geosite.db
热载 systemctl reload sing-box
重启 systemctl restart sing-box
状态 systemctl status sing-box
查看日志 journalctl -u sing-box -o cat -e
实时日志 journalctl -u sing-box -o cat -f

服务端

安装

  1. 下载程序(linux-amd64)或 编译程序
curl -Lo sing-box.tar.gz https://github.com/SagerNet/sing-box/releases/latest/download/$(curl https://api.github.com/repos/SagerNet/sing-box/releases|grep -E '"name": "sing-box-.*-linux-amd64.tar.gz"'|grep -Pv '(alpha|beta|rc)'|sed -n 's/.*"name": "\(.*\)".*/\1/p'|head -1) && tar -xzf sing-box.tar.gz && cp -f sing-box-*/sing-box . && rm -r sing-box.tar.gz sing-box-* && chown root:root sing-box && chmod +x sing-box && mv -f sing-box /usr/local/bin/
  1. 上传配置、证书和私钥
  • 将配置文件改名为 sing-box_config.json,将证书文件改名为 fullchain.cer,将私钥文件改名为 private.key,将它们上传到 /root 目录
  1. 下载systemctl配置
curl -Lo /etc/systemd/system/sing-box.service https://raw.githubusercontent.com/chika0801/sing-box-examples/main/sing-box.service && systemctl daemon-reload
  1. 启动程序
systemctl enable --now sing-box
项目
程序 /usr/local/bin/sing-box
配置 /root/sing-box_config.json
geoip /root/geoip.db
geosite /root/geosite.db
热载 systemctl reload sing-box
重启 systemctl restart sing-box
状态 systemctl status sing-box
查看日志 journalctl -u sing-box -o cat -e
实时日志 journalctl -u sing-box -o cat -f

卸载

systemctl disable --now sing-box && rm -f /usr/local/bin/sing-box /root/sing-box_config.json /etc/systemd/system/sing-box.service

客户端

Android 使用方法:

  1. 下载Android客户端程序SFA-arm64-v8a.apk

  2. 参考客户端配置示例,按需修改后导入。

Windows 使用方法:

  1. 下载Windows客户端程序sing-box-windows-amd64.zip

  2. 新建一个批处理文件,内容为:

start /min sing-box.exe run
  1. 参考客户端配置示例,按需修改后将文件名改为 config.json,与 sing-box.exe,批处理文件放在同一文件夹里。

  2. 右键点击 sing-box.exe 选择属性,选择兼容性,选择以管理员身份运行此程序,确定。

  3. 运行批处理文件,在弹出的用户账户控制对话框中,选择是。

     from https://github.com/chika0801/sing-box-examples 

    (相关帖子:https://briteming.blogspot.com/2023/11/tcp-brutal.html)

    ---------------------------------------------------------------------------------

    Get Sing-Box up and running quickly with our ultimate guide. With more features and better performance than v2ray-core and clash, our step-by-step instructions make installation easy. Includes working config.json files for anonymous use.

    vpnrouter.homes,  

    Ultimate Sing-Box Guide: Get Sing-Box Up and Running in No Time!

    Sing-Box Installation

    Effortless Configuration: Find Your Perfect config.json from Our Ready-Made List

    Create Your Custom config.json: Unlock the Power of Our easy json Blocks

    Master the Sing-Box: A Guide to Essential Commands

    Transform Your Home Network with Singbox VPN Router Gateway

    from https://github.com/bitcoinvps/singbox-vpn

    -------------------------------------------------------

    https://github.com/zzzgydi/sing-sword 

    -----------------------------------------------------------

    Argo sing-box for PaaS

    TIPS: 可点击仓库的“Use this template”在仓库的原基础上创建私库

    image

    项目特点

  4. 本项目用于在任意一家 PaaS 云服务商部署 Sing-box ,采用的方案为 Nginx + WebSocket + VMess/Vless/Trojan + TLS
  5. Sing-box 核心文件和配置文件作了“特殊处理”,每个项目都不同,大大降低被封和连坐风险
  6. vmess 和 vless 的 uuid 或 trojan 的密码,路径既可以自定义,又或者使用默认值
  7. 集成哪吒探针,可以自由选择是否安装
  8. 部署完成如发现不能上网,请检查域名是否被墙,可使用 Cloudflare CDN 或者 worker 解决。

部署

  • 注册任意一家 PaaS 云服务商

  • 根据 PaaS 云服务商的不同绑定自己的 github 账户或使用项目提供的Actions生成DockerHub镜像,严重建议小号+私库

  • 项目可用到的变量

    变量名 是否必须 默认值 备注
    UUID de04add9-5c68-8bab-950c-08cd5320df18 可在线生成 https://www.uuidgenerator.net/
    VMESS_WSPATH /vm 以 / 开头
    VLESS_WSPATH /vl 以 / 开头
    TROJAN_WSPATH /tr 以 / 开头
    NEZHA_SERVER
    哪吒探针服务端的 IP 或域名
    NEZHA_PORT
    哪吒探针服务端的端口
    NEZHA_KEY
    哪吒探针客户端专用 Key
  • GitHub Actions 用到的变量

    变量名 备注
    DOCKER_USERNAME Docker Hub 用户名
    DOCKER_PASSWORD Docker Hub 密码
    DOCKER_REPO Docker Hub 仓库名

image

from https://github.com/Misaka-blog/argo-sing-box-paas-dev


 ------------------------------------------------------------------------------

 




















No comments:

Post a Comment