Unbox is a CLI tool for sing-box that can do 3 things:
- Convert a file with
vless://,hysteria2://,trojan://links to full sing-box config - Remove unreachable nodes from sing-box config file (uses sing-box Clash API)
- Keep connection alive and switch to another proxy immediately if not (uses sing-box Clash API)
Expand
There are DockerHub and GitHub images:
docker pull aceberg/unboxdocker pull ghcr.io/aceberg/unboxAll available binaries are listed in the latest release.
For amd64 there is an apt repo.
For arm64 there are android and termux.deb files.
Expand
Here VLESS.txt is a file with vless://,hysteria2://,trojan:// links. Unbox will ignore anything else in the file, including other protocols and comments.
unbox -f VLESS.txtIn this example sing-box.tmpl.json is a template sing-box config and sing-box.json is where unbox will put generated config.
unbox -f VLESS.txt -t sing-box.tmpl.json -o sing-box.json -jDocker
docker run -it -v /your/local/path:/data \
aceberg/unbox \
-f /data/VLESS.txt \
-t /data/sing-box.tmpl.json \
-o /data/sing-box.json| Key | Description | Default |
|---|---|---|
| -f | Path to file with links | VLESS.txt |
| -j | Validate and Indent JSON output | |
| -n | Rename tags. If used, will rename tags to tag1, tag2... |
|
| -o | Path to output file | |
| -t | Path to template sing-box config. Example here. There are only two variables available in template: {{ .Unbox_tags }} and {{ .Unbox_outbounds }} |
Expand
unbox -a "http://127.0.0.1:9090" -o sing-box.json| Key | Description | Default |
|---|---|---|
| -a | URL to sing-box Clash API | |
| -o | Path to sing-box config file |
Expand
Use the -k flag to run unbox in keepalive mode
unbox -a "http://127.0.0.1:9090" -k| Key | Description | Default |
|---|---|---|
| -a | URL to sing-box Clash API | |
| -da | Delay between checks of all proxy servers (seconds). Use 0 to disable | 300 |
| -db | Delay between checks of 3-4 backup servers (seconds). Use 0 to disable | 30 |
| -dm | Delay between checks of the main server (seconds). Use 0 to disable | 5 |
| -k | Keepalive mode | |
| -u | URL to test proxies. https://www.gstatic.com/generate_204 will be used if empty |
