1. Prepare versions and recovery access
This guide follows current Project X documentation: raw transport, server-side target, and client-side password. Older articles may use tcp, dest or publicKey; do not casually combine version-specific examples. Download an official Xray-core release for the correct CPU architecture, verify the published release checksums and record the version. These are documentation examples, not commands executed on the listed providers.
Use a VPS you control, with SSH or console recovery, and an authorized target domain that supports the required TLS features. Replace origin.example.com, vps.example.com and every REPLACE_WITH_... value. The target must satisfy the official REALITY requirements and be reachable with suitable TLS support from the VPS.
xray version
xray uuid
xray x25519
openssl rand -hex 8
xray tls ping origin.example.com
Keep the generated UUID, server private key, corresponding client Password and sixteen-character hexadecimal short ID. The Password corresponds to X25519 public-key material, but the documentation says it should not be published openly. Do not put working credentials in a public repository, screenshot or article.
2. Server configuration
The example listens on TCP 8443 rather than assuming that 443 is free. Check conflicts with ss -ltnp, then allow the required port in the cloud and host firewalls without disabling the entire firewall. The client connects to the VPS address; the configured TLS target and allowed SNI are separate settings.
{
"log": {
"loglevel": "warning"
},
"inbounds": [
{
"listen": "0.0.0.0",
"port": 8443,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "REPLACE_WITH_UUID",
"flow": "xtls-rprx-vision"
}
],
"decryption": "none"
},
"streamSettings": {
"network": "raw",
"security": "reality",
"realitySettings": {
"show": false,
"target": "origin.example.com:443",
"xver": 0,
"serverNames": [
"origin.example.com"
],
"privateKey": "REPLACE_WITH_SERVER_PRIVATE_KEY",
"shortIds": [
"REPLACE_WITH_16_HEX_CHARACTERS"
]
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"tag": "direct"
}
]
}
Save this as server.json, replace all placeholders, and validate before starting:
xray run -test -config server.json
xray run -config server.json
The first command checks configuration only; the second runs in the foreground. For an existing installation, back up the configuration and use its supported systemd setup rather than overwriting a running service. Successful validation does not establish target reachability or an end-to-end connection.
3. Client configuration
The SOCKS listener binds only to 127.0.0.1:10808. Match the UUID, short ID and SNI with the server. Use the generated client value for password, not the server private key. The VPS hostname must resolve to your instance.
{
"log": {
"loglevel": "warning"
},
"inbounds": [
{
"listen": "127.0.0.1",
"port": 10808,
"protocol": "socks",
"settings": {
"auth": "noauth",
"udp": false
}
}
],
"outbounds": [
{
"protocol": "vless",
"settings": {
"vnext": [
{
"address": "vps.example.com",
"port": 8443,
"users": [
{
"id": "REPLACE_WITH_UUID",
"encryption": "none",
"flow": "xtls-rprx-vision"
}
]
}
]
},
"streamSettings": {
"network": "raw",
"security": "reality",
"realitySettings": {
"serverName": "origin.example.com",
"fingerprint": "chrome",
"password": "REPLACE_WITH_CLIENT_PASSWORD",
"shortId": "REPLACE_WITH_16_HEX_CHARACTERS"
}
}
}
]
}
Save this as client.json. Run xray run -test -config client.json before starting the client. Point one test application at the local SOCKS port and use an HTTPS destination you are authorized to access. Verify basic connectivity before examining DNS behavior, application compatibility and throughput.
4. Troubleshoot one layer at a time
For a connection timeout, check the VPS address, port and firewalls first. For a handshake failure, check clock accuracy, SNI, short ID and paired key material. For poor speed after connection, inspect CPU use, loss, transfer policies and the real network path. Begin with one client and a small number of connections instead of changing transport, congestion control and DNS together.
Keep both core versions, backups and a rollback binary recorded. Read release notes and validate before updates. Rotate compromised credentials and remove unused users. The route directory and finder help select resources; protocol configuration does not replace testing connectivity.