Sign inSign up

aceberg/unbox

By aceberg

•Updated 4 days ago

CLI tool for sing-box: auto switch. Convert URLs to sing-box config. Deduplicate. Remove unreachable

Image
Networking
0

10K+

aceberg/unbox repository overview

Main-Docker Binary-release Binary-Android

⁠ ⁠unbox


Unbox is a CLI tool for sing-box⁠ that has commands:

  1. examples: Show usage examples
  2. conf: Works with sing-box config file to
  3. keep: Keep connection alive, auto switch proxy⁠
  4. parse: Convert file with URLs to sing-box config⁠

Supported URLs: vless://,hysteria2:// or hy2://,trojan://
Experimental: anytls://, ss://, tuic://

⁠Screenshot

Expand

Screenshot_1

⁠Install

Expand
⁠Docker

Example keep command with sing-box Clash API:

docker run aceberg/unbox keep -a "http://192.168.0.11:9090"

Or use 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⁠.

⁠Deduplicate

Expand
unbox conf -d -o sing-box.json
KeyDescriptionDefault
-dDeduplicate
-oPath to sing-box config file

⁠Convert sing-box config outbounds to URLs

Expand
unbox conf -i sing-box.json > URLs.txt
KeyDescriptionDefault
-iPath to sing-box config file

⁠Remove unreachable nodes from sing-box config

Expand
unbox conf -a "http://127.0.0.1:9090" -o sing-box.json
KeyDescriptionDefault
-aURL of sing-box Clash API
-asClash API secret
-lTimeout for proxy delay (latency) check (ms)3000
-nNumber of best servers to save (0 - save all)0
-oPath to sing-box config file
-tlshHost to verify TLS certificategithub.com
-tlspSOCKS5 proxy address for TLS check (example "127.0.0.1:1080")
-uURL to test proxies. https://www.gstatic.com/generate_204 will be used if empty

⁠Keep connection alive and switch if not

Expand
unbox keep -a "http://127.0.0.1:9090"
KeyDescriptionDefault
-aURL of sing-box Clash API
-asClash API secret
-daDelay between checks of all proxy servers (seconds). Use 0 to disable300
-dbDelay between checks of 4-5 backup servers (seconds). Use 0 to disable30
-dmDelay between checks of the main server (seconds). Use 0 to disable5
-dsDelay between auto switch to a faster proxy attempts (seconds). Use 0 to disable300
-lTimeout for proxy delay (latency) check (ms)3000
-nNumber of backup servers5
-stSwitch to a faster proxy if it is at least this many ms faster than the current one (ms)50
-uURL to test proxies. https://www.gstatic.com/generate_204 will be used if empty

⁠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 parse -f VLESS.txt

In this example tmpl.json is a template⁠ sing-box config and sing-box.json is where unbox will put generated config.

unbox parse -f VLESS.txt -t tmpl.json -o sing-box.json -j
KeyDescriptionDefault
-fPath to file with URLsVLESS.txt
-jValidate and Indent JSON output
-nRename tags. If used, will rename tags to tag1, tag2...
-oPath to output sing-box config file
-pPrefix to add before each tag
-tPath to template sing-box config. Example here⁠. There are only two variables available in template: {{ .Unbox_tags }} and {{ .Unbox_outbounds }}

⁠Thanks

Tag summary

Content type

Image

Digest

sha256:cae6b8ba2…

Size

3.5 MB

Last updated

4 days ago

docker pull aceberg/unbox