Versions in this module Expand all Collapse all v0 v0.0.1 Sep 18, 2023 Changes in this version + const CommandClashMode + const CommandCloseConnections + const CommandGetSystemProxyStatus + const CommandGroup + const CommandGroupExpand + const CommandLog + const CommandSelectOutbound + const CommandServiceReload + const CommandSetClashMode + const CommandSetSystemProxyEnabled + const CommandStatus + const CommandURLTest + const MessageTypeError + const MessageTypeProfileContent + const MessageTypeProfileContentRequest + const MessageTypeProfileList + const ProfileTypeLocal + const ProfileTypeRemote + const ProfileTypeiCloud + func CheckConfig(configContent string) error + func DecodeLengthChunk(data []byte) int32 + func EncodeChunkedMessage(data []byte) []byte + func FormatBytes(length int64) string + func FormatConfig(configContent string) (string, error) + func GenerateRemoteProfileImportLink(name string, remoteURL string) string + func GetTunnelFileDescriptor() int32 — darwin/amd64 + func ProxyDisplayType(proxyType string) string + func RedirectStderr(path string) error — darwin/amd64, linux/amd64 + func RegisterLocalDNSTransport(transport LocalDNSTransport) + func SetMemoryLimit(enabled bool) + func Setup(basePath string, workingPath string, tempPath string, isTVOS bool) + func SetupWithUsername(basePath string, workingPath string, tempPath string, username string) error + func Version() string + type BoxService struct + func NewService(configContent string, platformInterface PlatformInterface) (*BoxService, error) + func (s *BoxService) Close() error + func (s *BoxService) Sleep() + func (s *BoxService) Start() error + func (s *BoxService) Wake() + type CommandClient struct + func NewCommandClient(handler CommandClientHandler, options *CommandClientOptions) *CommandClient + func NewStandaloneCommandClient() *CommandClient + func (c *CommandClient) CloseConnections() error + func (c *CommandClient) Connect() error + func (c *CommandClient) Disconnect() error + func (c *CommandClient) GetSystemProxyStatus() (*SystemProxyStatus, error) + func (c *CommandClient) SelectOutbound(groupTag string, outboundTag string) error + func (c *CommandClient) ServiceReload() error + func (c *CommandClient) SetClashMode(newMode string) error + func (c *CommandClient) SetGroupExpand(groupTag string, isExpand bool) error + func (c *CommandClient) SetSystemProxyEnabled(isEnabled bool) error + func (c *CommandClient) URLTest(groupTag string) error + type CommandClientHandler interface + Connected func() + Disconnected func(message string) + InitializeClashMode func(modeList StringIterator, currentMode string) + UpdateClashMode func(newMode string) + WriteGroups func(message OutboundGroupIterator) + WriteLog func(message string) + WriteStatus func(message *StatusMessage) + type CommandClientOptions struct + Command int32 + StatusInterval int64 + type CommandServer struct + func NewCommandServer(handler CommandServerHandler, maxLines int32) *CommandServer + func (s *CommandServer) Close() error + func (s *CommandServer) SetService(newService *BoxService) + func (s *CommandServer) Start() error + func (s *CommandServer) WriteMessage(message string) + type CommandServerHandler interface + GetSystemProxyStatus func() *SystemProxyStatus + ServiceReload func() error + SetSystemProxyEnabled func(isEnabled bool) error + type ErrorMessage struct + Message string + func DecodeErrorMessage(data []byte) (*ErrorMessage, error) + func (e *ErrorMessage) Encode() []byte + type ExchangeContext struct + func (c *ExchangeContext) ErrnoCode(code int32) + func (c *ExchangeContext) ErrorCode(code int32) + func (c *ExchangeContext) OnCancel(callback Func) + func (c *ExchangeContext) RawSuccess(result []byte) + func (c *ExchangeContext) Success(result string) + type Func interface + Invoke func() error + type HTTPClient interface + Close func() + KeepAlive func() + ModernTLS func() + NewRequest func() HTTPRequest + PinnedSHA256 func(sumHex string) + PinnedTLS12 func() + RestrictedTLS func() + TrySocks5 func(port int32) + func NewHTTPClient() HTTPClient + type HTTPRequest interface + Execute func() (HTTPResponse, error) + RandomUserAgent func() + SetContent func(content []byte) + SetContentString func(content string) + SetHeader func(key string, value string) + SetMethod func(method string) + SetURL func(link string) error + SetUserAgent func(userAgent string) + type HTTPResponse interface + GetContent func() ([]byte, error) + GetContentString func() (string, error) + WriteTo func(path string) error + type ImportRemoteProfile struct + Host string + Name string + URL string + func ParseRemoteProfileImportLink(importLink string) (*ImportRemoteProfile, error) + type InterfaceUpdateListener interface + UpdateDefaultInterface func(interfaceName string, interfaceIndex int32) + type LocalDNSTransport interface + Exchange func(ctx *ExchangeContext, message []byte) error + Lookup func(ctx *ExchangeContext, network string, domain string) error + Raw func() bool + type NetworkInterface struct + Addresses StringIterator + Index int32 + MTU int32 + Name string + type NetworkInterfaceIterator interface + HasNext func() bool + Next func() *NetworkInterface + type OnDemandRule interface + DNSSearchDomainMatch func() StringIterator + DNSServerAddressMatch func() StringIterator + InterfaceTypeMatch func() int32 + ProbeURL func() string + SSIDMatch func() StringIterator + Target func() int32 + type OnDemandRuleIterator interface + HasNext func() bool + Next func() OnDemandRule + type OutboundGroup struct + IsExpand bool + Selectable bool + Selected string + Tag string + Type string + func (g *OutboundGroup) GetItems() OutboundGroupItemIterator + type OutboundGroupItem struct + Tag string + Type string + URLTestDelay int32 + URLTestTime int64 + type OutboundGroupItemIterator interface + HasNext func() bool + Next func() *OutboundGroupItem + type OutboundGroupIterator interface + HasNext func() bool + Next func() *OutboundGroup + type PProfServer struct + func NewPProfServer(port int) *PProfServer + func (s *PProfServer) Close() error + func (s *PProfServer) Start() error + type PlatformInterface interface + AutoDetectInterfaceControl func(fd int32) error + ClearDNSCache func() + CloseDefaultInterfaceMonitor func(listener InterfaceUpdateListener) error + FindConnectionOwner func(ipProtocol int32, sourceAddress string, sourcePort int32, ...) (int32, error) + GetInterfaces func() (NetworkInterfaceIterator, error) + OpenTun func(options TunOptions) (int32, error) + PackageNameByUid func(uid int32) (string, error) + StartDefaultInterfaceMonitor func(listener InterfaceUpdateListener) error + UIDByPackageName func(packageName string) (int32, error) + UnderNetworkExtension func() bool + UsePlatformAutoDetectInterfaceControl func() bool + UsePlatformDefaultInterfaceMonitor func() bool + UsePlatformInterfaceGetter func() bool + UseProcFS func() bool + WriteLog func(message string) + type ProfileContent struct + AutoUpdate bool + Config string + LastUpdated int64 + Name string + RemotePath string + Type int32 + func DecodeProfileContent(data []byte) (*ProfileContent, error) + func (c *ProfileContent) Encode() []byte + type ProfileContentRequest struct + ProfileID int64 + func DecodeProfileContentRequest(data []byte) (*ProfileContentRequest, error) + func (r *ProfileContentRequest) Encode() []byte + type ProfileDecoder struct + func (d *ProfileDecoder) Decode(data []byte) error + func (d *ProfileDecoder) Iterator() ProfilePreviewIterator + type ProfileEncoder struct + func (e *ProfileEncoder) Append(profile *ProfilePreview) + func (e *ProfileEncoder) Encode() []byte + type ProfilePreview struct + Name string + ProfileID int64 + Type int32 + type ProfilePreviewIterator interface + HasNext func() bool + Next func() *ProfilePreview + type RoutePrefix struct + Address string + Prefix int32 + func (p *RoutePrefix) Mask() string + type RoutePrefixIterator interface + HasNext func() bool + Next func() *RoutePrefix + type StatusMessage struct + ConnectionsIn int32 + ConnectionsOut int32 + Downlink int64 + DownlinkTotal int64 + Goroutines int32 + Memory int64 + TrafficAvailable bool + Uplink int64 + UplinkTotal int64 + type StringIterator interface + HasNext func() bool + Next func() string + type SystemProxyStatus struct + Available bool + Enabled bool + type TunInterface interface + Close func() error + FileDescriptor func() int32 + type TunOptions interface + GetAutoRoute func() bool + GetDNSServerAddress func() (string, error) + GetExcludePackage func() StringIterator + GetHTTPProxyServer func() string + GetHTTPProxyServerPort func() int32 + GetIncludePackage func() StringIterator + GetInet4Address func() RoutePrefixIterator + GetInet4RouteAddress func() RoutePrefixIterator + GetInet6Address func() RoutePrefixIterator + GetInet6RouteAddress func() RoutePrefixIterator + GetMTU func() int32 + GetStrictRoute func() bool + IsHTTPProxyEnabled func() bool