Generate sing-box client configs from server configs, with QR code output
Project description
sing-box-config-converter
Generate a sing-box client config from a server config, with optional QR code output.
Supported protocols: hysteria2, shadowsocks, trojan
Supported transports: plain TCP/UDP, TLS (including Reality / XTLS)
Requirements
- Python 3.10+
- uv
Quick Start with uvx
No installation required — run directly with:
uvx sing-box-config-converter server.json
With QR code support:
uvx --with "sing-box-config-converter[qr]" sing-box-config-converter server.json
Installation
uv sync --extra qr
The --extra qr flag installs qrcode[pil] for QR code support. Omit it if you don't need QR output.
Usage
uv run sing-box-config-converter <server_config> [server_address] [options]
Arguments
| Argument | Description |
|---|---|
server_config |
Path to the sing-box server config JSON |
server_address |
Public IP or hostname for clients to connect to. If omitted, auto-detected from the current machine |
Options
| Option | Default | Description |
|---|---|---|
-o, --output |
client.json |
Output path for the generated client config |
--use-tun |
off | Use TUN inbound instead of mixed (SOCKS+HTTP) |
--mixed-port |
random | Port for mixed (SOCKS+HTTP) inbound |
--show-terminal-qr |
off | Print QR code as ASCII art in the terminal |
--qr-dir |
— | Directory to save QR code as a PNG image |
Examples
Generate a client config (server address auto-detected):
uv run sing-box-config-converter /etc/sing-box/config.json
Specify the server address explicitly:
uv run sing-box-config-converter /etc/sing-box/config.json 203.0.113.42
Use TUN mode and save a QR code image:
uv run sing-box-config-converter config.json 203.0.113.42 --use-tun --qr-dir ./qr
Print a QR code in the terminal:
uv run sing-box-config-converter config.json --show-terminal-qr
Output
The generated client config includes:
- Outbounds — one per supported inbound in the server config; wrapped in a
urltestselector when there are multiple - DNS — fakeip for remote,
223.5.5.5for local/direct - Route — DNS hijack, private IP bypass, sniff
- Inbound —
mixed(SOCKS5+HTTP) on a local port, ortunwithauto_route
Notes
__SERVER_ADDRESS__placeholders in the output are replaced with the provided (or auto-detected) server address.- QR codes encode the full client config JSON. Large configs may exceed QR capacity; consider sharing the config file directly if the QR is unreadable.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sing_box_config_converter-0.1.0.tar.gz.
File metadata
- Download URL: sing_box_config_converter-0.1.0.tar.gz
- Upload date:
- Size: 19.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9f5bcafb92b9635ad2f154b7d25f3508d087a20a4da1652d7087bc514a3b224
|
|
| MD5 |
c13909d3f2c2c4d99c8ee5b23ab4200f
|
|
| BLAKE2b-256 |
16f17082e9dbb6484ae1d55d71ac00fd125775e574010194b1110d74f65293ed
|
Provenance
The following attestation bundles were made for sing_box_config_converter-0.1.0.tar.gz:
Publisher:
publish.yml on hongshibao/sing-box-config-converter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sing_box_config_converter-0.1.0.tar.gz -
Subject digest:
e9f5bcafb92b9635ad2f154b7d25f3508d087a20a4da1652d7087bc514a3b224 - Sigstore transparency entry: 1358913790
- Sigstore integration time:
-
Permalink:
hongshibao/sing-box-config-converter@09fba2e96d437f00ce5c052a3233c126192d6998 -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/hongshibao
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@09fba2e96d437f00ce5c052a3233c126192d6998 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sing_box_config_converter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sing_box_config_converter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fabb8847b9b60ce45572937d7d97f84f261c3fcaa93affc93bcabbaeaf3b30f
|
|
| MD5 |
6e1a37abe759d612d29a70a2428f9b25
|
|
| BLAKE2b-256 |
54bf1783161ab4eaf2d88b70ecc92b76c6e62f7411353c2323ad9d9940da2ed6
|
Provenance
The following attestation bundles were made for sing_box_config_converter-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on hongshibao/sing-box-config-converter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sing_box_config_converter-0.1.0-py3-none-any.whl -
Subject digest:
6fabb8847b9b60ce45572937d7d97f84f261c3fcaa93affc93bcabbaeaf3b30f - Sigstore transparency entry: 1358913905
- Sigstore integration time:
-
Permalink:
hongshibao/sing-box-config-converter@09fba2e96d437f00ce5c052a3233c126192d6998 -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/hongshibao
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@09fba2e96d437f00ce5c052a3233c126192d6998 -
Trigger Event:
release
-
Statement type: