Documentation
¶
Overview ¶
Package probe measures server latency three ways, shared by the desktop and Android apps:
- TCP: time to open a TCP connection to the server. Fast, but only proves the port is reachable.
- HTTP: time until the server answers a plain HTTP request on its port.
- Real: start a temporary xray-core instance using the server and time a real request through it. Slowest, but the only mode that proves the server actually works (right keys, transport, encryption...).
Index ¶
Constants ¶
View Source
const ( ModeTCP = "tcp" ModeHTTP = "http" ModeReal = "real" // TestURL returns an empty 204 quickly from everywhere; it's what most // V2Ray clients use for "real delay". TestURL = "https://www.gstatic.com/generate_204" )
Variables ¶
This section is empty.
Functions ¶
func TimeRequest ¶ added in v0.14.1
TimeRequest measures a request's round trip through transport the way most V2Ray clients report "real delay": a first request opens the tunnel (TCP + TLS/REALITY handshakes to the server, then to the test site), and the second one -- reusing that connection -- is what's timed. Timing the first request alone mostly measures one-off handshakes, not latency.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.