Skip to content

aceberg/unbox

Repository files navigation

Main-Docker Binary-release Binary-Android

unbox


Unbox is a CLI tool for sing-box that can do 3 things:

  1. Convert a file with vless://,hysteria2://,trojan:// links to full sing-box config
  2. Remove unreachable nodes from sing-box config file (uses sing-box Clash API)
  3. Keep connection alive and switch to another proxy immediately if not (uses sing-box Clash API)

Screenshot

Expand

Screenshot_1

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 }}

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
-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
-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

Thanks

About

CLI tool for sing-box: auto switch proxies; convert VLESS, Trojan and Hysteria2 links into sing-box config

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors