이 페이지는 아직 한국어로 번역되지 않아 다른 언어로 표시됩니다.
Using your own REALITY server
The normal path is
sudo bx server up: it installs REALITY + hysteria2 on the VPS, picks an SNI and checks its certificate size, and finally prints the wholesudo bx setup …command, so you do not need this page. See Server.
This page is only for people who already have, or want to run their own, a sing-box (or Xray) VLESS-REALITY server: how to
configure it, and how to put together a vless:// link to hand to bx setup. On the client side, sing-box is already embedded in
bx; there is nothing to install.
Choosing the port and SNI
- Use port 443. REALITY disguises itself as HTTPS to a real website, so 443 is the most natural place for it; an unusual port stands out more. The only constraint is the firewall: both ufw on the server and your provider's security group must allow 443. Only if a real website already occupies 443 should you switch to a high port that is allowed.
- For the borrowed SNI, pick a site that supports TLS 1.3 + X25519 and has a small certificate chain (under about 4.5KB).
www.cloudflare.com(bx's default),www.apple.com,dl.google.com, andaddons.mozilla.orgall work. Do not usewww.microsoft.com: its certificate chain is too large, and the handshake always fails.
To check a candidate site on the VPS:
# TLS 1.3 and X25519 supported?
openssl s_client -connect www.cloudflare.com:443 -servername www.cloudflare.com -tls1_3 </dev/null 2>/dev/null | grep -iE 'TLSv1.3|X25519'
# How large is the certificate chain (smaller is more reliable)
openssl s_client -connect www.cloudflare.com:443 -servername www.cloudflare.com -tls1_3 -showcerts </dev/null 2>/dev/null | awk '/BEGIN CERT/,/END CERT/' | wc -c
Installing sing-box and generating keys
On an ordinary Ubuntu / Debian server, use sing-box's official install script:
curl -fsSL https://sing-box.app/install.sh | bash
sing-box version
sing-box generate uuid # → VLESS UUID
sing-box generate reality-keypair # → PrivateKey (goes into the server) / PublicKey (goes into the link)
sing-box generate rand --hex 8 # → short_id
Server configuration
/etc/sing-box/config.json (minimal configuration: one VLESS-REALITY inbound + one direct outbound):
{
"log": { "level": "info", "timestamp": true },
"inbounds": [{
"type": "vless",
"tag": "vless-reality-in",
"listen": "::",
"listen_port": 443,
"users": [{ "name": "primary", "uuid": "REPLACE_UUID", "flow": "xtls-rprx-vision" }],
"tls": {
"enabled": true,
"server_name": "www.cloudflare.com",
"reality": {
"enabled": true,
"handshake": { "server": "www.cloudflare.com", "server_port": 443 },
"private_key": "REPLACE_PRIVATE_KEY",
"short_id": ["REPLACE_SHORT_ID"]
}
}
}],
"outbounds": [{ "type": "direct", "tag": "direct" }]
}
sing-box check -c /etc/sing-box/config.json && echo OK
systemctl enable --now sing-box
ufw allow 443/tcp # your provider's security group must allow it too
Building the link and handing it to bx
vless://<UUID>@<VPS IP or domain>:443?security=reality&pbk=<PublicKey>&sid=<short_id>&sni=www.cloudflare.com&flow=xtls-rprx-vision&fp=chrome
The required parts are the UUID, address, port, security=reality, pbk, sid, and sni; flow defaults to xtls-rprx-vision and
fp defaults to chrome. For an Xray server, build the link from the same fields.
On your computer:
sudo bx setup 'vless://…' # writes the configuration and checks connectivity; does not turn protection on
bx up
bx status # Tunnel healthy
The link carries plaintext credentials; treat it like a password. Once the client connects, journalctl -u sing-box -f on the server
shows the inbound connections.
When it does not connect
- The server log shows no connections at all and the client times out: the port is not allowed through. Both ufw and the cloud security group must allow it.
- The port is reachable but the handshake fails (server log
processed invalid connection, client EOF): first suspect that the borrowed SNI's certificate chain is too large, and switch to a site with a small chain; it is usually not a key or network problem. - Testing connectivity on an OpenWrt router: BusyBox's
ashdoes not support/dev/tcp; usecurlornc, otherwise every result is a false negative.