probe

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2026 License: MIT Imports: 14 Imported by: 0

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 Ping

func Ping(server profile.Server, mode string) (int, error)

Ping returns the delay to server in milliseconds using mode.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL