libv2ray

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2025 License: LGPL-3.0 Imports: 15 Imported by: 0

README

AndroidLibXrayLite

Build requirements

  • JDK
  • Android SDK
  • Go
  • gomobile
    go install golang.org/x/mobile/cmd/gomobile@latest
    

Build instructions

  1. git clone -b spaceship https://github.com/zhangsan946/AndroidLibXrayLite && cd AndroidLibXrayLite
  2. gomobile init
  3. go mod tidy -v
  4. gomobile bind -v -androidapi 21 -trimpath -ldflags="-s -w -buildid=" ./

To update go mod at latest/specific commit

go get github.com/xtls/xray-core@latest
go get github.com/xtls/xray-core@98a72b6fb49b

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckVersion

func CheckVersion() string

CheckVersionX string This func will return libv2ray binding version and V2Ray version used.

func InitCoreEnv

func InitCoreEnv(envPath string, key string)

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 StartSimple

func StartSimple(configFile string, key int32) error

func StopSimple

func StopSimple(key int32)

Types

type CoreController

type CoreController struct {
	ConfigureFile string
	IsRunning     bool
	// contains filtered or unexported fields
}

CoreController represents a controller for managing Xray core instance lifecycle

func NewCoreController

func NewCoreController() *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) StartLoop

func (x *CoreController) StartLoop() (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()

StopLoop safely stops the core processing loop and releases resources Thread-safe method that shuts down the core instance and triggers necessary callbacks

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL