Documentation
¶
Index ¶
- func ForceGc()
- func InitCore(process, cachePath, internalAssets, externalAssets string, maxLogSizeKb int32, ...)
- func NekoLogClear()
- func NekoLogPrintln(s string)
- func RegisterLocalDNSTransport(transport LocalDNSTransport)
- func ResetAllConnections(system bool)
- func Sha1(data []byte) []byte
- func Sha256Hex(data []byte) string
- func Unxz(archive string, path string) error
- func Unzip(archive string, path string) error
- func UrlTest(i *BoxInstance, link string, timeout int32) (latency int32, err error)
- func VersionBox() string
- type BoxInstance
- func (b *BoxInstance) Close() (err error)
- func (b *BoxInstance) QueryStats(tag, direct string) int64
- func (b *BoxInstance) SelectOutbound(tag string) bool
- func (b *BoxInstance) SetAsMain()
- func (b *BoxInstance) SetConnectionPoolEnabled(enable bool)
- func (b *BoxInstance) SetV2rayStats(outbounds string)
- func (b *BoxInstance) Sleep()
- func (b *BoxInstance) Start() (err error)
- func (b *BoxInstance) Wake()
- type BoxPlatformInterface
- type ExchangeContext
- type Func
- type Geoip
- type Geosite
- type HTTPClient
- type HTTPRequest
- type HTTPResponse
- type LocalDNSTransport
- type NB4AInterface
- type StunResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitCore ¶
func InitCore(process, cachePath, internalAssets, externalAssets string, maxLogSizeKb int32, logEnable bool, if1 NB4AInterface, if2 BoxPlatformInterface, )
func NekoLogClear ¶
func NekoLogClear()
func NekoLogPrintln ¶
func NekoLogPrintln(s string)
func RegisterLocalDNSTransport ¶
func RegisterLocalDNSTransport(transport LocalDNSTransport)
func ResetAllConnections ¶
func ResetAllConnections(system bool)
func VersionBox ¶
func VersionBox() string
Types ¶
type BoxInstance ¶
func NewSingBoxInstance ¶
func NewSingBoxInstance(config string) (b *BoxInstance, err error)
func (*BoxInstance) Close ¶
func (b *BoxInstance) Close() (err error)
func (*BoxInstance) QueryStats ¶
func (b *BoxInstance) QueryStats(tag, direct string) int64
func (*BoxInstance) SelectOutbound ¶
func (b *BoxInstance) SelectOutbound(tag string) bool
func (*BoxInstance) SetAsMain ¶
func (b *BoxInstance) SetAsMain()
func (*BoxInstance) SetConnectionPoolEnabled ¶
func (b *BoxInstance) SetConnectionPoolEnabled(enable bool)
func (*BoxInstance) SetV2rayStats ¶
func (b *BoxInstance) SetV2rayStats(outbounds string)
func (*BoxInstance) Sleep ¶
func (b *BoxInstance) Sleep()
func (*BoxInstance) Start ¶
func (b *BoxInstance) Start() (err error)
func (*BoxInstance) Wake ¶
func (b *BoxInstance) Wake()
type BoxPlatformInterface ¶
type BoxPlatformInterface interface { AutoDetectInterfaceControl(fd int32) error OpenTun(singTunOptionsJson, tunPlatformOptionsJson string) (int, error) UseProcFS() bool FindConnectionOwner(ipProtocol int32, sourceAddress string, sourcePort int32, destinationAddress string, destinationPort int32) (int32, error) PackageNameByUid(uid int32) (string, error) UIDByPackageName(packageName string) (int32, error) WIFIState() string }
type ExchangeContext ¶
type ExchangeContext struct {
// contains filtered or unexported fields
}
func (*ExchangeContext) ErrnoCode ¶
func (c *ExchangeContext) ErrnoCode(code int32)
func (*ExchangeContext) ErrorCode ¶
func (c *ExchangeContext) ErrorCode(code int32)
func (*ExchangeContext) OnCancel ¶
func (c *ExchangeContext) OnCancel(callback Func)
func (*ExchangeContext) RawSuccess ¶
func (c *ExchangeContext) RawSuccess(result []byte)
func (*ExchangeContext) Success ¶
func (c *ExchangeContext) Success(result string)
type Geoip ¶
type Geoip struct {
// contains filtered or unexported fields
}
func (*Geoip) ConvertGeoip ¶
func (*Geoip) OpenGeosite ¶
type Geosite ¶
type Geosite struct {
// contains filtered or unexported fields
}
func (*Geosite) CheckGeositeCode ¶
func (*Geosite) ConvertGeosite ¶
ConvertGeosite need to run CheckGeositeCode first
type HTTPClient ¶
type HTTPClient interface { RestrictedTLS() ModernTLS() PinnedTLS12() PinnedSHA256(sumHex string) TrySocks5(port int32) KeepAlive() NewRequest() HTTPRequest Close() }
func NewHttpClient ¶
func NewHttpClient() HTTPClient
type HTTPRequest ¶
type HTTPResponse ¶
type LocalDNSTransport ¶
type LocalDNSTransport interface { Raw() bool Lookup(ctx *ExchangeContext, network string, domain string) error Exchange(ctx *ExchangeContext, message []byte) error }
type NB4AInterface ¶
type StunResult ¶
func StunTest ¶
func StunTest(server string) *StunResult
Source Files
¶
Click to show internal directories.
Click to hide internal directories.