Documentation
¶
Index ¶
- Constants
- func InboundBuilder(config *Config, nodeInfo *api.TrojanConfig) (*core.InboundHandlerConfig, error)
- func OutboundBuilder(ctx context.Context, nodeInfo *api.TrojanConfig, extConfigBytes []byte) (*core.OutboundHandlerConfig, error)
- type APIClient
- type Builder
- type CertConfig
- type Config
- type FallBackConfig
- type Service
Constants ¶
View Source
const ( TLS = "tls" TCP = "tcp" WS = "ws" GRPC = "grpc" )
Variables ¶
This section is empty.
Functions ¶
func InboundBuilder ¶
func InboundBuilder(config *Config, nodeInfo *api.TrojanConfig) (*core.InboundHandlerConfig, error)
InboundBuilder build Inbound config for different protocol
func OutboundBuilder ¶
func OutboundBuilder(ctx context.Context, nodeInfo *api.TrojanConfig, extConfigBytes []byte) (*core.OutboundHandlerConfig, error)
OutboundBuilder build monster outbund config for addoutbound
Types ¶
type APIClient ¶ added in v0.3.0
type APIClient interface {
Users(string, api.NodeType) (*[]api.User, error)
Submit(string, api.NodeType, []*api.UserTraffic) error
Heartbeat(string, api.NodeType, string) error
}
APIClient 定义了与API服务器交互所需的方法接口
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func New ¶
func New(inboundTag string, instance *core.Instance, config *Config, nodeInfo *api.TrojanConfig, registerId string, apiClient APIClient, ) *Builder
New return a builder service with default parameters.
type CertConfig ¶
type FallBackConfig ¶
Click to show internal directories.
Click to hide internal directories.