Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckVersionX ¶
func CheckVersionX() string
CheckVersionX returns the library and Xray versions
func InitCoreEnv ¶
InitCoreEnv initializes environment variables and file system handlers for the core It sets up asset path, certificate path, XUDP base key and customizes the file reader to support Android asset system
Types ¶
type CoreCallbackHandler ¶
CoreCallbackHandler defines interface for receiving callbacks and notifications from the core service
type CoreController ¶
type CoreController struct { CallbackHandler CoreCallbackHandler IsRunning bool // contains filtered or unexported fields }
CoreController represents a controller for managing Xray core instance lifecycle
func NewCoreController ¶
func NewCoreController(s CoreCallbackHandler) *CoreController
NewCoreController initializes and returns a new CoreController instance Sets up the console log handler and associates it with the provided callback handler
func (*CoreController) MeasureDelay ¶
func (x *CoreController) MeasureDelay(url string) (int64, error)
MeasureDelay measures network latency to a specified URL through the current core instance Uses a 12-second timeout context and returns the round-trip time in milliseconds An error is returned if the connection fails or returns an unexpected status
func (*CoreController) QueryStats ¶
func (x *CoreController) QueryStats(tag string, direct string) int64
QueryStats retrieves and resets traffic statistics for a specific outbound tag and direction Returns the accumulated traffic value and resets the counter to zero Returns 0 if the stats manager is not initialized or the counter doesn't exist
func (*CoreController) StartLoop ¶
func (x *CoreController) StartLoop(configContent string) (err error)
StartLoop initializes and starts the core processing loop Thread-safe method that configures and runs the Xray core with the provided configuration Returns immediately if the core is already running
func (*CoreController) StopLoop ¶
func (x *CoreController) StopLoop() error
StopLoop safely stops the core processing loop and releases resources Thread-safe method that shuts down the core instance and triggers necessary callbacks