Documentation ¶
Index ¶
- func CustomUUID(text string) string
- func InitEnv(datDir string)
- func LoadGeoData(datDir string, name string, geoType string) error
- func Ping(datDir string, configPath string, timeout int, url string, proxy string) (int64, error)
- func QueryStats(server string) (string, error)
- func RunXray(datDir string, configPath string, maxMemory int64) (err error)
- func StartXray(configPath string) (*core.Instance, error)
- func StopXray() error
- func TestXray(datDir string, configPath string) error
- func XrayVersion() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadGeoData ¶
Read geo data and write all codes to text file. datDir means the dir which geo dat are in. name means the geo dat file name, like "geosite", "geoip" geoType must be the value of geoType
func Ping ¶
Ping Xray config and find the delay and country code of its outbound. datDir means the dir which geosite.dat and geoip.dat are in. configPath means the config.json file path. timeout means how long the http request will be cancelled if no response, in units of seconds. url means the website we use to test speed. "https://www.google.com" is a good choice for most cases. proxy means the local http/socks5 proxy, like "socks5://[::1]:1080".
func QueryStats ¶
query inbound and outbound stats. server means The metrics server address, like "http://[::1]:49227/debug/vars".
func RunXray ¶
Run Xray instance. datDir means the dir which geosite.dat and geoip.dat are in. configPath means the config.json file path. maxMemory means the soft memory limit of golang, see SetMemoryLimit to find more information.
Types ¶
This section is empty.