Documentation
¶
Index ¶
- func CheckVersionX() string
- func FetchQuicCertSha256(requestJSON string) string
- func FetchTlsCertSha256(requestJSON string) string
- func InitCoreEnv(envPath string, key string)
- func MeasureOutboundDelay(ConfigureFileContent string, url string) (int64, error)
- func ReconcileBrowserDialer(dialerAddr string)
- type CoreCallbackHandler
- type CoreController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckVersionX ¶
func CheckVersionX() string
CheckVersionX returns the library and Xray versions
func FetchQuicCertSha256 ¶
func FetchTlsCertSha256 ¶
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
func MeasureOutboundDelay ¶
MeasureOutboundDelay measures the outbound delay for a given configuration and URL
func ReconcileBrowserDialer ¶
func ReconcileBrowserDialer(dialerAddr string)
ReconcileBrowserDialer updates the browser dialer address and reloads its configuration If the dialer address is empty, it will disable the browser dialer and close existing connections
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) QueryAllOutboundTrafficStats ¶
func (x *CoreController) QueryAllOutboundTrafficStats() string
QueryAllOutboundTrafficStats retrieves and resets all outbound traffic counters. Returns a single-line text in format: tag,direction,value;tag,direction,value; Returns an empty string if the stats manager is not initialized or no counters exist.
func (*CoreController) StartLoop ¶
func (x *CoreController) StartLoop(configContent string, tunFd int32) (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