Documentation
¶
Overview ¶
Package selftest answers the question a health page can't: not "is Xray running?" but "does a client actually get through?". For each enabled protocol it spins up a throwaway Xray client — a local SOCKS inbound in front of that protocol's outbound, pointed back at our own inbound — and sends real traffic through it to the public internet. Success means the credentials, TLS, ALPN and transport all line up end-to-end and traffic egresses through this server.
What it does NOT prove: reachability from the outside world. The probe dials the inbound over loopback, so the host's own firewall and the provider's edge (the usual reason a fresh Hysteria2/UDP port "doesn't work") are bypassed. This is the automated form of the `curl -x socks5h://…` check you'd otherwise run by hand — it catches config mismatches and dead protocols, not blocked ports.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
Proto string `json:"proto"` // model.Proto* key
Label string `json:"label"` // human name for the UI
OK bool `json:"ok"` // traffic made it out and back
Detail string `json:"detail"` // one-line explanation, always set
ExitIP string `json:"exit_ip,omitempty"`
}
Result is one protocol's verdict.