Documentation
¶
Overview ¶
Package controller Package generate the InboundConfig used by add inbound
Index ¶
- Variables
- func BuildWSEndpoint(wsConfig *api.WSConfig, runtimeConfig *WebSocketConfig) (string, error)
- func InboundBuilder(config *Config, nodeInfo *api.NodeInfo, tag string) (*core.InboundHandlerConfig, error)
- func InboundBuilderWithUsers(config *Config, nodeInfo *api.NodeInfo, tag string, userInfo *[]api.UserInfo) (*core.InboundHandlerConfig, error)
- func OutboundBuilder(config *Config, nodeInfo *api.NodeInfo, tag string) (*core.OutboundHandlerConfig, error)
- type AutoSpeedLimitConfig
- type Config
- type Controller
- func (c *Controller) AddInboundLimiter(tag string, nodeSpeedLimit uint64, userList *[]api.UserInfo, ...) error
- func (c *Controller) Close() error
- func (c *Controller) CloseContext(parent context.Context) error
- func (c *Controller) DeleteInboundLimiter(tag string) error
- func (c *Controller) ExecuteSyncAction(ctx context.Context, action syncAction) error
- func (c *Controller) GetDetectResult(tag string) (*[]api.DetectResult, error)
- func (c *Controller) GetOnlineDevice(tag string) (*[]api.OnlineUser, error)
- func (c *Controller) ObservabilitySnapshot() service.RuntimeSnapshot
- func (c *Controller) SetWSEventRuntimeFactory(factory WSEventRuntimeFactory)
- func (c *Controller) Start() error
- func (c *Controller) StartContext(parent context.Context) error
- func (c *Controller) SyncAliveList(tag string, aliveList map[int][]string) error
- func (c *Controller) UpdateInboundLimiter(tag string, updatedUserList *[]api.UserInfo) error
- func (c *Controller) UpdateRule(tag string, newRuleList []api.DetectRule) error
- type FallBackConfig
- type LimitInfo
- type NodeHandlerBuilder
- func (b *NodeHandlerBuilder) BuildInbound(tag string) (*core.InboundHandlerConfig, error)
- func (b *NodeHandlerBuilder) BuildInboundWithUsers(tag string, users []api.UserInfo) (*core.InboundHandlerConfig, error)
- func (b *NodeHandlerBuilder) BuildOutbound(tag string) (*core.OutboundHandlerConfig, error)
- type PanelClient
- type REALITYConfig
- type WSEventRuntimeFactory
- type WSEventSubmitter
- type WSRuntimeLifecycle
- type WebSocketConfig
Constants ¶
This section is empty.
Variables ¶
var AEADMethod = map[shadowsocks.CipherType]uint8{ shadowsocks.CipherType_AES_128_GCM: 0, shadowsocks.CipherType_AES_256_GCM: 0, shadowsocks.CipherType_CHACHA20_POLY1305: 0, shadowsocks.CipherType_XCHACHA20_POLY1305: 0, }
Functions ¶
func BuildWSEndpoint ¶
func BuildWSEndpoint(wsConfig *api.WSConfig, runtimeConfig *WebSocketConfig) (string, error)
func InboundBuilder ¶
func InboundBuilder(config *Config, nodeInfo *api.NodeInfo, tag string) (*core.InboundHandlerConfig, error)
InboundBuilder is the compatibility adapter for callers that still provide api.NodeInfo. Internal controller paths call buildInbound with a focused view.
func InboundBuilderWithUsers ¶
func InboundBuilderWithUsers(config *Config, nodeInfo *api.NodeInfo, tag string, userInfo *[]api.UserInfo) (*core.InboundHandlerConfig, error)
InboundBuilderWithUsers is the compatibility adapter for callers that still provide api.NodeInfo. Internal controller paths call buildInboundWithUsers with the focused listener view.
func OutboundBuilder ¶
func OutboundBuilder(config *Config, nodeInfo *api.NodeInfo, tag string) (*core.OutboundHandlerConfig, error)
OutboundBuilder is the compatibility adapter for callers that still provide api.NodeInfo. Internal controller paths call buildOutbound with a focused view.
Types ¶
type AutoSpeedLimitConfig ¶
type Config ¶
type Config struct {
ListenIP string `mapstructure:"ListenIP"`
SendIP string `mapstructure:"SendIP"`
UpdatePeriodic int `mapstructure:"UpdatePeriodic"`
CertConfig *mylego.CertConfig `mapstructure:"CertConfig"`
EnableDNS bool `mapstructure:"EnableDNS"`
DNSType string `mapstructure:"DNSType"`
DisableUploadTraffic bool `mapstructure:"DisableUploadTraffic"`
DisableGetRule bool `mapstructure:"DisableGetRule"`
EnableProxyProtocol bool `mapstructure:"EnableProxyProtocol"`
EnableFallback bool `mapstructure:"EnableFallback"`
DisableIVCheck bool `mapstructure:"DisableIVCheck"`
DisableSniffing bool `mapstructure:"DisableSniffing"`
AutoSpeedLimitConfig *AutoSpeedLimitConfig `mapstructure:"AutoSpeedLimitConfig"`
GlobalDeviceLimitConfig *limiter.GlobalDeviceLimitConfig `mapstructure:"GlobalDeviceLimitConfig"`
FallBackConfigs []*FallBackConfig `mapstructure:"FallBackConfigs"`
DisableLocalREALITYConfig bool `mapstructure:"DisableLocalREALITYConfig"`
EnableREALITY bool `mapstructure:"EnableREALITY"`
REALITYConfigs *REALITYConfig `mapstructure:"REALITYConfigs"`
WebSocketConfig *WebSocketConfig `mapstructure:"WebSocketConfig"`
ShowErrorDetails bool `mapstructure:"-"`
}
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func New ¶
func New(server *core.Instance, apiClient PanelClient, config *Config, panelType string) *Controller
New return a Controller service with default parameters.
func (*Controller) AddInboundLimiter ¶
func (c *Controller) AddInboundLimiter(tag string, nodeSpeedLimit uint64, userList *[]api.UserInfo, globalDeviceLimitConfig *limiter.GlobalDeviceLimitConfig) error
func (*Controller) Close ¶
func (c *Controller) Close() error
Close implement the Close() function of the service interface.
func (*Controller) CloseContext ¶
func (c *Controller) CloseContext(parent context.Context) error
func (*Controller) DeleteInboundLimiter ¶
func (c *Controller) DeleteInboundLimiter(tag string) error
func (*Controller) ExecuteSyncAction ¶
func (c *Controller) ExecuteSyncAction(ctx context.Context, action syncAction) error
func (*Controller) GetDetectResult ¶
func (c *Controller) GetDetectResult(tag string) (*[]api.DetectResult, error)
func (*Controller) GetOnlineDevice ¶
func (c *Controller) GetOnlineDevice(tag string) (*[]api.OnlineUser, error)
func (*Controller) ObservabilitySnapshot ¶
func (c *Controller) ObservabilitySnapshot() service.RuntimeSnapshot
func (*Controller) SetWSEventRuntimeFactory ¶
func (c *Controller) SetWSEventRuntimeFactory(factory WSEventRuntimeFactory)
func (*Controller) Start ¶
func (c *Controller) Start() error
Start implement the Start() function of the service interface.
func (*Controller) StartContext ¶
func (c *Controller) StartContext(parent context.Context) error
func (*Controller) SyncAliveList ¶
func (c *Controller) SyncAliveList(tag string, aliveList map[int][]string) error
func (*Controller) UpdateInboundLimiter ¶
func (c *Controller) UpdateInboundLimiter(tag string, updatedUserList *[]api.UserInfo) error
func (*Controller) UpdateRule ¶
func (c *Controller) UpdateRule(tag string, newRuleList []api.DetectRule) error
type FallBackConfig ¶
type NodeHandlerBuilder ¶
type NodeHandlerBuilder struct {
// contains filtered or unexported fields
}
NodeHandlerBuilder owns normalized node and configuration inputs for constructing Xray inbound and outbound handlers. Its fields are deliberately opaque because the owned inputs may contain credentials or private keys.
func NewNodeHandlerBuilder ¶
func NewNodeHandlerBuilder(config *Config, nodeInfo *api.NodeInfo) (*NodeHandlerBuilder, error)
NewNodeHandlerBuilder prepares an owned handler-construction interface. Mutating config or nodeInfo after this call does not affect later builds.
func (*NodeHandlerBuilder) BuildInbound ¶
func (b *NodeHandlerBuilder) BuildInbound(tag string) (*core.InboundHandlerConfig, error)
BuildInbound constructs an inbound handler from the owned inputs.
func (*NodeHandlerBuilder) BuildInboundWithUsers ¶
func (b *NodeHandlerBuilder) BuildInboundWithUsers(tag string, users []api.UserInfo) (*core.InboundHandlerConfig, error)
BuildInboundWithUsers constructs a Socks or HTTP inbound with embedded users.
func (*NodeHandlerBuilder) BuildOutbound ¶
func (b *NodeHandlerBuilder) BuildOutbound(tag string) (*core.OutboundHandlerConfig, error)
BuildOutbound constructs an outbound handler from the owned inputs.
type PanelClient ¶
type PanelClient interface {
// contains filtered or unexported methods
}
type REALITYConfig ¶
type REALITYConfig struct {
Show bool `mapstructure:"Show"`
Dest string `mapstructure:"Dest"`
ProxyProtocolVer uint64 `mapstructure:"ProxyProtocolVer"`
ServerNames []string `mapstructure:"ServerNames"`
PrivateKey string `mapstructure:"PrivateKey"`
MinClientVer string `mapstructure:"MinClientVer"`
MaxClientVer string `mapstructure:"MaxClientVer"`
MaxTimeDiff uint64 `mapstructure:"MaxTimeDiff"`
ShortIds []string `mapstructure:"ShortIds"`
}
type WSEventRuntimeFactory ¶
type WSEventRuntimeFactory func(WSEventSubmitter) (WSRuntimeLifecycle, error)
type WSEventSubmitter ¶
type WSEventSubmitter interface {
SubmitWSEvent(*newV2board.WSEvent)
SubmitWSParseError()
SubmitWSDisconnect()
SubmitWSReconnect()
}
type WSRuntimeLifecycle ¶
type WSRuntimeLifecycle interface {
Start()
Stop()
}
type WebSocketConfig ¶
Source Files
¶
- certificate.go
- config.go
- config_clone.go
- control.go
- controller.go
- devicestate.go
- errors.generated.go
- handlerbuilder.go
- inboundbuilder.go
- lifecycle.go
- nodevalue.go
- nodeviews.go
- observability.go
- outboundbuilder.go
- outboundpolicy.go
- periodic.go
- reporting.go
- state.go
- submit.go
- syncapply.go
- synccoordinator.go
- syncevent.go
- syncexecutionstate.go
- userbuilder.go
- userdiff.go
- wsruntime.go
- xray_handlers.go