Performance optimization for gRPC/H2
mainhealth check parameters in your Xray configuration.repository·main·Indexed 21 days ago
https://github.com/chika0801/xray-examplesConfiguration examples for Xray-core focusing on transport protocols including VLESS with Vision, REALITY, gRPC, and WebSocket. Includes setup guides for clients such as v2rayN, v2rayNG, Shadowrocket, PassWall, ShadowSocksR Plus+, and HomeProxy, as well as technical details on Mux (Multiplexing) and MPTCP (Multi-Path TCP) requirements.
health check parameters in your Xray configuration.gRPC or H2 transport protocols, it is recommended to use a VPS with optimized return routing (e.g., CN2-GIA, AS9929/AS10099, CMI/CMIN2, AS4837). Lower latency between the client and the VPS is critical for performance. For further optimization, consider using the health check parameters in the Xray configuration.The choice of the target domain/website used in REALITY significantly impacts latency, speed, and stability. Consider the following factors:
The domainStrategy setting in the WireGuard outbound determines how Xray resolves domain names before sending the connection through the WireGuard tunnel.
| domainStrategy | chat.openai.com | Notes |
|---|---|---|
ForceIPv6v4 | IPv6 | Recommended for using Cloudflare's IPv4 via WARP |
ForceIPv6 | IPv6 | May cause issues if the site doesn't support IPv6 |
ForceIPv4v6 | IPv4 | Might trigger browser warnings about IPv6 availability |
ForceIPv4 | IPv4 | Forces IPv4 |
ForceIP (default) | IPv6 | Uses Xray's internal DNS to get IP, then sends via WireGuard |
When using gRPC or H2 transports, it is recommended to use a VPS with optimized return routing (e.g., CN2-GIA, AS9929/AS10099, CMI/CMIN2, AS4837). Performance is highly dependent on low latency between the client and the VPS.
To improve stability and performance, consider:
healthCheck parameter in your Xray configuration to monitor connection quality.WSS is considered deprecated for high-security needs due to several identifiable features:
http/1.1, making it easily identifiable.Recommendations:
?ed=2048 to mitigate handshake issues.policy settings. Avoid using the default values (e.g., 60s handshake, 300s connection idle) as they create a recognizable signature.You can fetch WARP credentials in sing-box format using the following command. You will need to extract the IPv6 address, private_key, and reserved values for your Xray configuration.
2606:4700:: in your config with this address (append /128).secretKey field.reserved field.curl -sL "https://api.zeroteam.top/warp?format=sing-box" | grep -Eo --color=never '"2606:4700:[0-9a-f:]+/128"|"private_key":"[0-9a-zA-Z\/\+]+="|"reserved":\[[0-9]+(,[0-9]+){2}\]'Alternatively, you can use the warp-reg.sh script via a one-line bash command.
bash -c "$(curl -L warp-reg.vercel.app)"Since REALITY acts as a port forwarder for non-REALITY clients, accessing the IP directly via a browser will likely result in certificate errors or unexpected responses.
To correctly verify the REALITY port forwarding using a browser:
hosts file.serverName) to your server's IP.To minimize the risk of port or IP blocking when using XTLS Vision, follow these configuration requirements:
uTLS (fingerprint) enabled.Note: Even with correct configuration, 100% protection is not guaranteed. If a port is blocked, try changing the port, the IP, or the service provider.