client

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SingBoxGeoIPFileName   string = "geoip.db"
	SingboxGeoSiteFileName string = "geosite.db"
	XrayCoreEnableSocksEnv string = "XRAY_CORE_ENABLE_SOCKS"
)

Variables

View Source
var SingBoxConfigString string = `` /* 2654-byte string literal not displayed */

Docs: https://sing-box.sagernet.org/zh/configuration/

View Source
var XrayCoreConfigStr = `` /* 2106-byte string literal not displayed */

Docs: https://xtls.github.io/config/#%E6%A6%82%E8%BF%B0

Functions

func PrepareConfig

func PrepareConfig(out IOutbound, inboundPort int, logPath, geoInfoDir string) (conf []byte)

Types

type IClient

type IClient interface {
	SetInPortAndLogFile(int, string)
	SetAssetDir(string)
	SetOutbound(IOutbound)
	GetConf() []byte
	Start() error
	Close()
	Type() string
}

func NewClient

func NewClient(cnf *conf.NeoConf, inboundPort int, cType outbound.ClientType, enableLog bool) (client IClient)

type IOutbound

type IOutbound interface {
	GetHost() string
	GetOutbound() string
	GetOutboundType() outbound.ClientType
}

type SInstance

type SInstance struct {
	*box.Box
	// contains filtered or unexported fields
}

func NewSClient

func NewSClient() *SInstance

func (*SInstance) Close

func (that *SInstance) Close()

func (*SInstance) GetConf

func (that *SInstance) GetConf() []byte

func (*SInstance) SetAssetDir

func (that *SInstance) SetAssetDir(geoinfoDir string)

func (*SInstance) SetInPortAndLogFile

func (that *SInstance) SetInPortAndLogFile(inboundPort int, logPath string)

func (*SInstance) SetOutbound

func (that *SInstance) SetOutbound(out IOutbound)

func (*SInstance) Start

func (that *SInstance) Start() (err error)

func (*SInstance) Type

func (that *SInstance) Type() string

type XInstance

type XInstance struct {
	*core.Instance
	// contains filtered or unexported fields
}

func NewXClient

func NewXClient() *XInstance

func (*XInstance) Close

func (that *XInstance) Close()

func (*XInstance) GetConf

func (that *XInstance) GetConf() []byte

func (*XInstance) SetAssetDir

func (that *XInstance) SetAssetDir(geoinfoDir string)

func (*XInstance) SetInPortAndLogFile

func (that *XInstance) SetInPortAndLogFile(inboundPort int, logPath string)

func (*XInstance) SetOutbound

func (that *XInstance) SetOutbound(out IOutbound)

func (*XInstance) Start

func (that *XInstance) Start() error

func (*XInstance) Type

func (that *XInstance) Type() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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