CLI tool for sing-box: auto switch proxies; convert VLESS, Trojan and Hysteria2 links into sing-box config
https://hub.docker.com/r/aceberg/unbox
- Go 97%
- Makefile 1.9%
- Dockerfile 1%
- Shell 0.1%
|
|
||
|---|---|---|
| .github | README upd | |
| android | Release v0.1.2 | |
| assets | Logo and Screenshot | |
| configs | Release 0.1.0 | |
| internal | Better func names | |
| pkg | Better func names | |
| .gitignore | Parse VLESS | |
| .goreleaser.yaml | Release v0.1.2 | |
| .version | Release v0.3.2 | |
| CHANGELOG.md | Release v0.3.2 | |
| Dockerfile | Release v0.2.2 | |
| go.mod | Select server | |
| LICENSE | Initial commit | |
| main.go | Struct to URL | |
| Makefile | Struct to URL | |
| README.md | Release v0.3.1 | |
Main-Docker Binary-release Binary-Android
unbox
Unbox is a CLI tool for sing-box that can do 5 things:
- Convert a file with
vless://,hysteria2://,trojan://links to full sing-box config - Convert sing-box config outbounds to URLs
- Remove unreachable nodes from sing-box config file (uses sing-box Clash API)
- Remove duplicate outbounds from sing-box config file
- Keep connection alive. Switch to another proxy immediately if not. Optional - switch to a faster proxy (uses sing-box Clash API)
Screenshot
Expand
Install
Expand
Docker
There are DockerHub and GitHub images:
docker pull aceberg/unbox
docker pull ghcr.io/aceberg/unbox
Binary
All available binaries are listed in the latest release.
For amd64 there is an apt repo.
Android and Termux
For arm64 there are android and termux.deb files.
Convert file with URLs to sing-box config
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.txt
In 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 -j
Docker
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 }} |
Convert sing-box config outbounds to URLs
Expand
unbox -i sing-box.json > URLs.txt
| Key | Description | Default |
|---|---|---|
| -i | Path to sing-box config file |
Remove unreachable nodes from sing-box config
Expand
unbox -a "http://127.0.0.1:9090" -o sing-box.json
| Key | Description | Default |
|---|---|---|
| -a | URL to sing-box Clash API | |
| -as | Clash API secret | |
| -o | Path to sing-box config file |
Remove duplicate outbounds from sing-box config
Expand
unbox -d -o sing-box.json
| Key | Description | Default |
|---|---|---|
| -d | Deduplicate | |
| -o | Path to sing-box config file |
Keep connection alive and switch if not
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 | |
| -as | Clash API secret | |
| -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 |
| -ds | Delay between auto switch to a faster proxy attempts (seconds). Use 0 to disable | 300 |
| -k | Keepalive mode | |
| -u | URL to test proxies. https://www.gstatic.com/generate_204 will be used if empty |