bx
Қазақша — Тіл

Бұл бет әлі қазақ тіліне аударылмаған; төменде басқа тілдегі нұсқасы көрсетілген.

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

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