Very high latency with VLESS+XHTTP+REALITY #5716
-
|
So I'm trying to setup a personal VPN server for a friend in Russia (I am outside of Russia). So far everything has went well with Xray-core, however the Latency seems really bad? At least in practise. I am doing these tests on my own Network. This has about 8 MByte/s Download speed with I think about 2 MByte/s up. The TCPing to my server is about 15 ms, while the "Real Delay" in v2RayNG is 20 ms. Seems fine so far. Trying to load YouTube in Firefox though takes 7 seconds (when all resources are cached already). Usually it's 0.5 seconds. BBR is enabled. This delay already took place even with Any Idea what is going on here? I am unsure about both the server and client configuration. Here's the server configuration, it's just the default but a bit more adapted: // REFERENCE:
// https://github.com/XTLS/Xray-examples
// https://xtls.github.io/config/
// Common config files, whether server or client, have 5 parts. Plus newbie interpretation:
// ┌─ 1*log Log Settings - What to write, where to write (evidence available when errors occur)
// ├─ 2_dns DNS Settings - How to query DNS (prevent DNS pollution, prevent snooping, avoid matching domestic sites to foreign servers, etc.)
// ├─ 3_routing Routing Settings - How to classify and process traffic (whether to filter ads, split domestic/international traffic)
// ├─ 4_inbounds Inbound Settings - What traffic can flow into Xray
// └─ 5_outbounds Outbound Settings - Where the traffic flowing out of Xray goes
{
// 1_Log Settings
"log": {
"loglevel": "warning" // Content from least to most: "none", "error", "warning", "info", "debug"
},
// 2_DNS Settings
"dns": {
"servers": [
"https+local://1.1.1.1/dns-query", // Prefer 1.1.1.1 DoH query, sacrifices speed but prevents ISP snooping
"localhost"
]
},
// 3_Routing Settings
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
// 3.1 Prevent local server loop issues: e.g., intranet attacks or abuse, wrong local loops, etc.
{
"ip": [
"geoip:private" // Routing condition: rules named "private" in the geoip file (local)
],
"outboundTag": "block" // Routing strategy: hand over to outbound "block" processing (blackhole blocking)
},
// {
// // 3.2 Prevent server from directly connecting to domestic (CN) IPs
// "ip": ["geoip:ru"],
// "outboundTag": "block"
// },
// 3.3 Block Ads
{
"domain": [
"geosite:category-ads-all" // Routing condition: rules named "category-ads-all" in the geosite file (various ad domains)
],
"outboundTag": "block" // Routing strategy: hand over to outbound "block" processing (blackhole blocking)
}
]
},
// 4_Inbound Settings
// 4.1 Here only one simplest vless+xtls inbound is written, because this is Xray's most powerful mode. If needed, please add others based on templates.
"inbounds": [
{
"port": 25565,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "****", // Fill in your UUID
"flow": "xtls-rprx-vision",
"level": 0,
"email": "vpsadmin@yourdomain.com"
}
],
"decryption": "****"
// "fallbacks": [
// {
// "dest": 80 // Default fallback to the probe-resistant proxy
// }
// ]
},
"streamSettings": {
"network": "xhttp",
"xhttpSettings": {
"path": "/search"
},
"security": "reality",
"realitySettings": {
"dest": "yandex.com:443", // A website that support TLS1.3 and h2. You can also use `1.1.1.1:443` as dest
"serverNames": [
"yandex.com", // A server name in the cert of dest site. If you use `1.1.1.1:443` as dest, then you can leave `serverNames` empty, it is a possible ways to bypass Iran's internet speed restrictions.
"mail.yandex.com",
"yandex.ru"
],
"privateKey": "****", // run `xray x25519` to generate. Public and private keys need to be corresponding.
"shortIds": [// Required, list of shortIds available to clients, can be used to distinguish different clients
"", // If this item exists, client shortId can be empty
"****"
]
}
},
"sniffing": {
"enabled": true,
"destOverride": ["http", "tls", "quic"],
"routeOnly": true
}
}
],
// 5_Outbound Settings
"outbounds": [
// 5.1 The first outbound is the default rule, freedom is direct connection (VPS is already on the external network, so direct connection)
{
"tag": "direct",
"protocol": "freedom"
},
// 5.2 Blocking rule, blackhole protocol sends traffic into a black hole (blocking)
{
"tag": "block",
"protocol": "blackhole"
}
]
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
不用上下行分离,上行cdn,下行直连,network使用raw比较好。可以试试 |
Beta Was this translation helpful? Give feedback.
-
|
After arguing with Claude for two days I finally pinned down the issue! In short: It's DNS. In long: Go's Network Stack (Dialer? and DNS resolver) are extremely slow on my system for some odd reason. Maybe it just doesn't play nice with systemd-resolved and NetworkManager; who knows, because I don't. Forcing Xray to use its own networking stack fixes this. The changes needed are as follows: {
"dns": {
"servers": [
"https+local://1.1.1.1/dns-query" // Configure at least one server
// DO NOT set localhost as a server, since that uses Go's DNS Resolver / Network Stack.
]
},
"outbounds": [
{
"tag": "direct",
"protocol": "freedom",
"settings": {
"domainStrategy": "UseIP" // Uses Xray's Dial instead of Go's to make connections.
}
}
]
}The Symptoms for this were that whenever a DNS request was sent through Xray the request took ~2.2 seconds to complete. EDIT: Turns out Go exclusively uses |
Beta Was this translation helpful? Give feedback.
After arguing with Claude for two days I finally pinned down the issue! In short: It's DNS.
In long: Go's Network Stack (Dialer? and DNS resolver) are extremely slow on my system for some odd reason. Maybe it just doesn't play nice with systemd-resolved and NetworkManager; who knows, because I don't. Forcing Xray to use its own networking stack fixes this.
The changes needed are as follows:
{ "dns": { "servers": [ "https+local://1.1.1.1/dns-query" // Configure at least one server // DO NOT set localhost as a server, since that uses Go's DNS Resolver / Network Stack. ] }, "outbounds": [ { "tag": "direct", "…