libv2ray

package module
v0.0.0-...-d3533ef Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: AGPL-3.0 Imports: 30 Imported by: 0

README

AndroidLibV2Ray

Build Status

在安卓设备上使用V2RayGo

若在使用vmess+tcp(即最基本的设置), 请按conf文件夹中的conf_vpnservice.json为模板进行修改;
若在使用ws+tls,请按照conf文件夹中的conf_ws_vpnservice.json为模板进行修改;

如果想更多的了解LibV2Ray, 请点击这里
需要自行编译请参考 这个 issue.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckVersion

func CheckVersion() int

CheckVersion int This func will return libv2ray binding version.

func CheckVersionX

func CheckVersionX() string

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

func ClearAssetsOverride

func ClearAssetsOverride(path string)

ClearAssetsOverride can disable an override at given @path.

ClearAssetsOverride("geoip.dat") will ask libv2ray to serve vanilla asset file.

func SetAssetsOverride

func SetAssetsOverride(path string, data string)

SetAssetsOverride will define file path @[data] to provide the asset named @path.

SetAssetsOverride("geoip.dat","/data/data/appdir/dat/geoip-override.dat") will ask libv2ray to serve v2ray "geoip.dat" with file "/data/data/appdir/dat/geoip-override.dat" in file system

Types

type InterfaceInfo

type InterfaceInfo struct {
	RxByte, RxPacket, TxByte, TxPacket int
}

type QRScanContext

type QRScanContext struct {
	ScanReporter QRScanReport
	// contains filtered or unexported fields
}
var CurrentScan *QRScanContext

func (*QRScanContext) Discard

func (qs *QRScanContext) Discard()

func (*QRScanContext) Finish

func (qs *QRScanContext) Finish(name string) bool

func (*QRScanContext) Init

func (qs *QRScanContext) Init()

func (*QRScanContext) OnNewScanResult

func (qs *QRScanContext) OnNewScanResult(data string, allowdiscard bool) string

type QRScanReport

type QRScanReport interface {
	ReadyToFinish()
	StatUpdate(need, acquired int)
}

type StabilityAssist

type StabilityAssist struct {
	Engaged   bool
	Forground bool

	SASS StabilityAssistSupportSet
	// contains filtered or unexported fields
}

func GetStabilityAssist

func GetStabilityAssist() *StabilityAssist

func (*StabilityAssist) ProbeNowOpi

func (sa *StabilityAssist) ProbeNowOpi()

func (*StabilityAssist) Start

func (sa *StabilityAssist) Start()

func (*StabilityAssist) Stop

func (sa *StabilityAssist) Stop()

type StabilityAssistSupportSet

type StabilityAssistSupportSet interface {
	OnProbeFailed()
}

type StatControler

type StatControler struct {
	InterfaceTarget        string
	CollectedInterfaceInfo *InterfaceInfo
}

func (*StatControler) CollectInterfaceInfo

func (sc *StatControler) CollectInterfaceInfo() error

type StringArrayList

type StringArrayList struct {
	// contains filtered or unexported fields
}

func (*StringArrayList) GetElementById

func (al *StringArrayList) GetElementById(id int) string

func (*StringArrayList) GetLen

func (al *StringArrayList) GetLen() int

type V2RayCallbacks

type V2RayCallbacks interface {
	OnEmitStatus(int, string) int
}

V2RayCallbacks a Callback set for V2Ray

type V2RayContext

type V2RayContext struct {
	Callbacks V2RayContextCallbacks
	Status    *CoreI.Status
	// contains filtered or unexported fields
}

func NewLib2rayContext

func NewLib2rayContext() *V2RayContext

func (*V2RayContext) AssignConfigureFile

func (vc *V2RayContext) AssignConfigureFile(cf string)

func (*V2RayContext) CheckConfigureFile

func (vc *V2RayContext) CheckConfigureFile() bool

func (*V2RayContext) GetBriefDesc

func (vc *V2RayContext) GetBriefDesc(pathn string) string

func (*V2RayContext) GetConfigureFile

func (vc *V2RayContext) GetConfigureFile() string

func (*V2RayContext) ListConfigureFileDir

func (vc *V2RayContext) ListConfigureFileDir() *StringArrayList

func (*V2RayContext) ReadProp

func (vc *V2RayContext) ReadProp(name string) (string, error)

func (*V2RayContext) ReadPropD

func (vc *V2RayContext) ReadPropD(name string) string

func (*V2RayContext) ScanQR

func (vc *V2RayContext) ScanQR() *QRScanContext

func (*V2RayContext) SetPackageName

func (vc *V2RayContext) SetPackageName(PackageName string)

func (*V2RayContext) WriteProp

func (vc *V2RayContext) WriteProp(name string, cont string) error

type V2RayContextCallbacks

type V2RayContextCallbacks interface {
	OnRefreshNeeded()
	OnFileSelectTriggerd()
}

type V2RayPoint

type V2RayPoint struct {
	EnvCreater Process.EnvironmentCreater

	Callbacks V2RayCallbacks

	Context       *V2RayContext
	VPNSupports   *VPN.VPNSupport
	UpdownScripts *UpDownScript.UpDownScript

	//Legacy prop, should use Context instead
	PackageName          string
	ConfigureFile        string
	ConfigureFileContent string
	// contains filtered or unexported fields
}

V2RayPoint V2Ray Point Server This is territory of Go, so no getter and setters!

Notice: ConfigureFile can be either the path of config file or "V2Ray_internal/ConfigureFileContent" in case you wish to provide configure file with @[ConfigureFileContent] in JSON format or "V2Ray_internal/AsPbConfigureFileContent" in protobuf format.

func NewV2RayPoint

func NewV2RayPoint() *V2RayPoint

NewV2RayPoint new V2RayPoint

func (*V2RayPoint) GetIsRunning

func (v *V2RayPoint) GetIsRunning() bool

func (*V2RayPoint) GetStatControler

func (v *V2RayPoint) GetStatControler() *StatControler

func (*V2RayPoint) IsDebugTriggered

func (v *V2RayPoint) IsDebugTriggered() bool

func (*V2RayPoint) NetworkInterrupted

func (v *V2RayPoint) NetworkInterrupted()

NetworkInterrupted inform us to restart the v2ray, closing dead connections.

func (*V2RayPoint) OptinNextGenerationTunInterface

func (v *V2RayPoint) OptinNextGenerationTunInterface()

func (*V2RayPoint) RunLoop

func (v *V2RayPoint) RunLoop()

RunLoop Run V2Ray main loop

func (*V2RayPoint) SetDataDir

func (v *V2RayPoint) SetDataDir(path string)

func (*V2RayPoint) SetVpnSupportSet

func (v *V2RayPoint) SetVpnSupportSet(vs V2RayVPNServiceSupportsSet)

Delegate Funcation

func (*V2RayPoint) StopLoop

func (v *V2RayPoint) StopLoop()

StopLoop Stop V2Ray main loop

func (*V2RayPoint) UpgradeToContext

func (v *V2RayPoint) UpgradeToContext()

Client can opt-in V2Ray's Next Generation Interface

func (*V2RayPoint) VpnSupportReady

func (v *V2RayPoint) VpnSupportReady()

Delegate Funcation

type V2RayVPNServiceSupportsSet

type V2RayVPNServiceSupportsSet interface {
	GetVPNFd() int
	Setup(Conf string) int
	Prepare() int
	Shutdown() int
	Protect(int) int
	OnUDPBuffer([]byte) int
}

V2RayVPNServiceSupportsSet To support Android VPN mode

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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