Documentation ¶
Index ¶
- Constants
- func CheckConfig(configContent string) error
- func ClientCloseConnections(sharedDirectory string) error
- func ClientServiceReload(sharedDirectory string) error
- func ClientServiceStop(sharedDirectory string) error
- func FormatBytes(length int64) string
- func FormatConfig(configContent string) (string, error)
- func RedirectStderr(path string) error
- func RedirectStderrAsUser(path string, uid, gid int) error
- func RegisterLocalDNSTransport(transport LocalDNSTransport)
- func Setup(basePath string, tempPath string, userID int, groupID int)
- func Version() string
- type BoxService
- type CommandClient
- type CommandClientHandler
- type CommandClientOptions
- type CommandServer
- type CommandServerHandler
- type ExchangeContext
- type Func
- type HTTPClient
- type HTTPRequest
- type HTTPResponse
- type InterfaceUpdateListener
- type LocalDNSTransport
- type NetworkInterface
- type NetworkInterfaceIterator
- type OnDemandRule
- type OnDemandRuleIterator
- type PProfServer
- type PlatformInterface
- type RoutePrefix
- type RoutePrefixIterator
- type StatusMessage
- type StringIterator
- type TunInterface
- type TunOptions
Constants ¶
View Source
const ( CommandLog int32 = iota CommandStatus CommandServiceStop CommandServiceReload CommandCloseConnections )
Variables ¶
This section is empty.
Functions ¶
func CheckConfig ¶
func ClientCloseConnections ¶
func ClientServiceReload ¶
func ClientServiceStop ¶
func FormatBytes ¶
func FormatConfig ¶
func RedirectStderr ¶
func RedirectStderrAsUser ¶
func RegisterLocalDNSTransport ¶
func RegisterLocalDNSTransport(transport LocalDNSTransport)
Types ¶
type BoxService ¶
type BoxService struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(configContent string, platformInterface PlatformInterface) (*BoxService, error)
func (*BoxService) Close ¶
func (s *BoxService) Close() error
func (*BoxService) Start ¶
func (s *BoxService) Start() error
type CommandClient ¶
type CommandClient struct {
// contains filtered or unexported fields
}
func NewCommandClient ¶
func NewCommandClient(sharedDirectory string, handler CommandClientHandler, options *CommandClientOptions) *CommandClient
func (*CommandClient) Connect ¶
func (c *CommandClient) Connect() error
func (*CommandClient) Disconnect ¶
func (c *CommandClient) Disconnect() error
type CommandClientHandler ¶
type CommandClientHandler interface { Connected() Disconnected(message string) WriteLog(message string) WriteStatus(message *StatusMessage) }
type CommandClientOptions ¶
type CommandServer ¶
type CommandServer struct {
// contains filtered or unexported fields
}
func NewCommandServer ¶
func NewCommandServer(sharedDirectory string, handler CommandServerHandler) *CommandServer
func (*CommandServer) Close ¶
func (s *CommandServer) Close() error
func (*CommandServer) Start ¶
func (s *CommandServer) Start() error
func (*CommandServer) WriteMessage ¶
func (s *CommandServer) WriteMessage(message string)
type CommandServerHandler ¶
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 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 InterfaceUpdateListener ¶
type LocalDNSTransport ¶
type LocalDNSTransport interface { Raw() bool Lookup(ctx *ExchangeContext, network string, domain string) error Exchange(ctx *ExchangeContext, message []byte) error }
type NetworkInterface ¶
type NetworkInterface struct { Index int32 MTU int32 Name string Addresses StringIterator }
type NetworkInterfaceIterator ¶
type NetworkInterfaceIterator interface { Next() *NetworkInterface HasNext() bool }
type OnDemandRule ¶
type OnDemandRule interface { Target() int32 DNSSearchDomainMatch() StringIterator DNSServerAddressMatch() StringIterator InterfaceTypeMatch() int32 SSIDMatch() StringIterator ProbeURL() string }
type OnDemandRuleIterator ¶
type OnDemandRuleIterator interface { Next() OnDemandRule HasNext() bool }
type PProfServer ¶
type PProfServer struct {
// contains filtered or unexported fields
}
func NewPProfServer ¶
func NewPProfServer(port int) *PProfServer
func (*PProfServer) Close ¶
func (s *PProfServer) Close() error
func (*PProfServer) Start ¶
func (s *PProfServer) Start() error
type PlatformInterface ¶
type PlatformInterface interface { UsePlatformAutoDetectInterfaceControl() bool AutoDetectInterfaceControl(fd int32) error OpenTun(options TunOptions) (int32, error) WriteLog(message string) 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) UsePlatformDefaultInterfaceMonitor() bool StartDefaultInterfaceMonitor(listener InterfaceUpdateListener) error CloseDefaultInterfaceMonitor(listener InterfaceUpdateListener) error UsePlatformInterfaceGetter() bool GetInterfaces() (NetworkInterfaceIterator, error) UnderNetworkExtension() bool }
type RoutePrefix ¶
func (*RoutePrefix) Mask ¶
func (p *RoutePrefix) Mask() string
type RoutePrefixIterator ¶
type RoutePrefixIterator interface { Next() *RoutePrefix HasNext() bool }
type StatusMessage ¶
type StringIterator ¶
type TunInterface ¶
type TunOptions ¶
type TunOptions interface { GetInet4Address() RoutePrefixIterator GetInet6Address() RoutePrefixIterator GetDNSServerAddress() (string, error) GetMTU() int32 GetAutoRoute() bool GetStrictRoute() bool GetInet4RouteAddress() RoutePrefixIterator GetInet6RouteAddress() RoutePrefixIterator GetIncludePackage() StringIterator GetExcludePackage() StringIterator IsHTTPProxyEnabled() bool GetHTTPProxyServer() string GetHTTPProxyServerPort() int32 }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.