Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAlreadyRunning = errors.New("xray is already running")
Functions ¶
Types ¶
type PingBatchItem ¶ added in v1.260728.0
type PingBatchResult ¶ added in v1.260728.0
type PingBatchResult struct {
Success bool
Delay int64
Error string
LocationJSON *string
LocationError string
}
func PingBatch ¶ added in v1.260728.0
func PingBatch( items []PingBatchItem, timeout int, targetURL string, ) ([]PingBatchResult, error)
Example ¶
results, _ := PingBatch(
[]PingBatchItem{{XrayJSON: `{"outbounds":[{"protocol":"freedom"}]}`}},
5,
"https://cp.cloudflare.com/",
)
fmt.Println(len(results))
func PingBatchWithLocation ¶ added in v1.260909.0
func PingBatchWithLocation(items []PingBatchItem, timeout int, targetURL, locationURL string) ([]PingBatchResult, error)
PingBatchWithLocation uses the same forced-outbound client for latency and optional location probes. The two probe results are independent.
Click to show internal directories.
Click to hide internal directories.