Coder Social home page Coder Social logo

sing-box-examples-config-gfw_proxy's Introduction

TCP Brutal 使用指南

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

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

Hysteria 是多倍发包吗?

My response to the recent controversy about TCP Brutal

服务端安装 TCP Brutal

客户端配置

            "multiplex": {
                "enabled": true,
                "protocol": "h2mux", // smux / yamux / h2mux
                "max_connections": 4,
                "min_streams": 4,
                "padding": true, // false / true
                "brutal": {
                    "enabled": true,
                    "up_mbps": 50,
                    "down_mbps": 1000
                }
            }

支持的:ShadowTLS / Shadowsocks / Trojan / VLESS / VLESS-REALITY / VMess-WebSocket

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

  2. 两端 "padding" 必须一致

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

示例配置
{
    "inbounds": [
        {
            "type": "mixed",
            "listen": "::",
            "listen_port": 10000
        }
    ],
    "outbounds": [
        {
            "type": "vless",
            "server": "233.33.33.33",
            "server_port": 443,
            "uuid": "chika",
            "flow": "",
            "tls": {
                "enabled": true,
                "server_name": "www.lovelive-anime.jp",
                "utls": {
                    "enabled": true,
                    "fingerprint": "chrome"
                }
             },
            "packet_encoding": "xudp",
            "multiplex": {
                "enabled": true,
                "protocol": "h2mux",
                "max_connections": 4,
                "min_streams": 4,
                "padding": true,
                "brutal": {
                    "enabled": true,
                    "up_mbps": 50,
                    "down_mbps": 1000
                }
            }
        }
    ]
}

服务端配置

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

支持的:ShadowTLS / Shadowsocks / Trojan / VLESS / VLESS-REALITY / VMess-WebSocket

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

  2. 两端 "padding" 必须一致

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

示例配置
{
    "inbounds": [
        {
            "type": "vless",
            "listen": "::",
            "listen_port": 443,
            "users": [
                {
                    "uuid": "chika",
                    "flow": ""
                }
            ],
            "tls": {
                "enabled": true,
                "certificate_path": "/root/fullchain.cer",
                "key_path": "/root/private.key"
            },
            "multiplex": {
                "enabled": true,
                "padding": true,
                "brutal": {
                    "enabled": true,
                    "up_mbps": 100,
                    "down_mbps": 1000
                }
            }
        }
    ],
    "outbounds": [
        {
            "type": "direct"
        }
    ]
}

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/download/v1.6.2/sing-box-1.6.2-linux-amd64.tar.gz && 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. 运行批处理文件,在弹出的用户账户控制对话框中,选择是。

sing-box-examples-config-gfw_proxy's People

Contributors

chika0801 avatar chise0713 avatar agustyuzu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.