andy19896/sing-box-loadbalancing

By andy19896

Updated 8 months ago

Sing-box with load balancing feature.

Image
Networking
0

225

andy19896/sing-box-loadbalancing repository overview

NOT suitable for subscription users.

{
    "inbounds": [
        {
            "type": "tun",
            "tag": "tun_in",
            "address": [
                "172.19.0.1/30"
            ],
            "auto_route": true
        }
    ],
    "outbounds": [
        {
            "type": "direct",
            "tag": "direct"
        },
        {
            "type": "vmess",
            "tag": "vmess1",
            "server": "x.x.x.x",
            "server_port": xxx,
            "uuid": "xxxx-xxxxx-xxxx-xxxx-xxxxxx",
            "security": "auto",
            "alter_id": 0,
            "domain_resolver": "local"
        },
        {
            "type": "vmess",
            "tag": "vmess2",
            "server": "x.x.x.x",
            "server_port": xxx,
            "uuid": "xxxx-xxxxx-xxxx-xxxx-xxxxxx",
            "security": "auto",
            "alter_id": 0,
            "domain_resolver": "local"
        },
        {
            "type": "loadbalance",
            "tag": "loadbalance_out",
            "outbounds": [
                "vmess1",
                "vmess2"
            ],
            "strategy": "round_robin", // <- random or round_robin
            "url": "http://www.gstatic.com/generate_204",
            "interval": "1m",
            "tolerance": 50,
            "idle_timeout": "30m",
            "interrupt_exist_connections": false
        }
    ],
    "route": {
        "rules": [
            {
                "inbound": "tun_in",
                "action": "sniff",
                "timeout": "300ms"
            },
            {
                "inbound": "tun_in",
                "action": "resolve",
                "strategy": "prefer_ipv4"
            },
            {
                "protocol": "dns",
                "action": "hijack-dns"
            },
            {
                "ip_is_private": true,
                "outbound": "direct"
            }
        ],
        "auto_detect_interface": true,
        "default_domain_resolver": "local",
        "final": "loadbalance_out"
    }
}

Tag summary

Content type

Image

Digest

sha256:7f1ce75a4

Size

21.9 MB

Last updated

8 months ago

docker pull andy19896/sing-box-loadbalancing