Documentation
¶
Index ¶
- Variables
- type ApiConfig
- type CertConfig
- type Conf
- type CoreConfig
- type DynamicSpeedLimitConfig
- type FallBackConfigForXray
- type IpReportConfig
- type LimitConfig
- type LogConfig
- type NodeConfig
- type Options
- type RecorderConfig
- type RedisConfig
- type WebSocketConfig
- type XrayConfig
- type XrayConnectionConfig
- type XrayLogConfig
- type XrayOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMissingEnvVar = errors.New("missing required env var")
Functions ¶
This section is empty.
Types ¶
type CertConfig ¶
type CertConfig struct {
CertMode string `json:"CertMode"` // none, file, http, dns
RejectUnknownSni bool `json:"RejectUnknownSni"`
CertDomain string `json:"CertDomain"`
CertFile string `json:"CertFile"`
KeyFile string `json:"KeyFile"`
Provider string `json:"Provider"` // alidns, cloudflare, gandi, godaddy....
Email string `json:"Email"`
DNSEnv map[string]string `json:"DNSEnv"`
}
func NewCertConfig ¶
func NewCertConfig() *CertConfig
func (*CertConfig) UnmarshalJSON ¶ added in v0.10.0
func (c *CertConfig) UnmarshalJSON(data []byte) error
type Conf ¶
type Conf struct {
LogConfig LogConfig `json:"Log"`
CoresConfig []CoreConfig `json:"Cores"`
NodeConfig []NodeConfig `json:"Nodes"`
}
func (*Conf) LoadFromPath ¶
type CoreConfig ¶
type CoreConfig struct {
Type string `json:"Type"`
Name string `json:"Name"`
XrayConfig *XrayConfig `json:"-"`
}
func (*CoreConfig) UnmarshalJSON ¶
func (c *CoreConfig) UnmarshalJSON(b []byte) error
type DynamicSpeedLimitConfig ¶
type FallBackConfigForXray ¶
type IpReportConfig ¶
type IpReportConfig struct {
Periodic int `json:"Periodic"`
Type string `json:"Type"`
RecorderConfig *RecorderConfig `json:"RecorderConfig"`
RedisConfig *RedisConfig `json:"RedisConfig"`
EnableIpSync bool `json:"EnableIpSync"`
}
type LimitConfig ¶
type LimitConfig struct {
EnableRealtime bool `json:"EnableRealtime"`
SpeedLimit int `json:"SpeedLimit"`
IPLimit int `json:"DeviceLimit"`
ConnLimit int `json:"ConnLimit"`
EnableIpRecorder bool `json:"EnableIpRecorder"`
IpRecorderConfig *IpReportConfig `json:"IpRecorderConfig"`
EnableDynamicSpeedLimit bool `json:"EnableDynamicSpeedLimit"`
DynamicSpeedLimitConfig *DynamicSpeedLimitConfig `json:"DynamicSpeedLimitConfig"`
}
type NodeConfig ¶
func (*NodeConfig) UnmarshalJSON ¶
func (n *NodeConfig) UnmarshalJSON(data []byte) (err error)
type Options ¶
type Options struct {
Name string `json:"Name"`
Core string `json:"Core"`
CoreName string `json:"CoreName"`
ListenIP string `json:"ListenIP"`
SendIP string `json:"SendIP"`
DeviceOnlineMinTraffic int64 `json:"DeviceOnlineMinTraffic"`
ReportMinTraffic int64 `json:"ReportMinTraffic"`
LimitConfig LimitConfig `json:"LimitConfig"`
RawOptions json.RawMessage `json:"RawOptions"`
XrayOptions *XrayOptions `json:"XrayOptions"`
CertConfig *CertConfig `json:"CertConfig"`
}
func (*Options) UnmarshalJSON ¶
type RecorderConfig ¶
type RedisConfig ¶
type WebSocketConfig ¶ added in v0.8.0
type WebSocketConfig struct {
// Enabled opts in to the WS driver. Leave false to stay on pure HTTP.
Enabled bool `json:"Enabled"`
// URL is the full ws:// or wss:// endpoint, e.g. wss://api.example.com/ws/.
// When empty the driver derives it from ApiHost (http -> ws, https -> wss)
// and appends /ws/.
URL string `json:"URL"`
// Debug enables verbose per-message logs; use while commissioning.
Debug bool `json:"Debug"`
}
WebSocketConfig controls the optional WebSocket driver that talks to the X-Board /ws/ endpoint. Default zero value keeps the driver disabled so an N2X upgrade is a no-op for existing deployments; flip Enabled to true only after verifying panel support.
type XrayConfig ¶
type XrayConfig struct {
LogConfig *XrayLogConfig `json:"Log"`
AssetPath string `json:"AssetPath"`
DnsConfigPath string `json:"DnsConfigPath"`
RouteConfigPath string `json:"RouteConfigPath"`
ConnectionConfig *XrayConnectionConfig `json:"ConnectionConfig"`
LegacyConnConfig *XrayConnectionConfig `json:"XrayConnectionConfig"`
InboundConfigPath string `json:"InboundConfigPath"`
OutboundConfigPath string `json:"OutboundConfigPath"`
}
func NewXrayConfig ¶
func NewXrayConfig() *XrayConfig
func (*XrayConfig) UnmarshalJSON ¶ added in v0.5.2
func (x *XrayConfig) UnmarshalJSON(b []byte) error
type XrayConnectionConfig ¶
type XrayConnectionConfig struct {
StatsUserUplink bool `json:"statsUserUplink"`
StatsUserDownlink bool `json:"statsUserDownlink"`
Handshake uint32 `json:"handshake"`
ConnIdle uint32 `json:"connIdle"`
UplinkOnly uint32 `json:"uplinkOnly"`
DownlinkOnly uint32 `json:"downlinkOnly"`
BufferSize int32 `json:"bufferSize"`
}
type XrayLogConfig ¶
type XrayOptions ¶
type XrayOptions struct {
EnableProxyProtocol bool `json:"EnableProxyProtocol"`
EnableDNS bool `json:"EnableDNS"`
DNSType string `json:"DNSType"`
EnableUot bool `json:"EnableUot"`
EnableTFO bool `json:"EnableTFO"`
DisableIVCheck bool `json:"DisableIVCheck"`
DisableSniffing bool `json:"DisableSniffing"`
EnableFallback bool `json:"EnableFallback"`
FallBackConfigs []FallBackConfigForXray `json:"FallBackConfigs"`
}
func NewXrayOptions ¶
func NewXrayOptions() *XrayOptions
Click to show internal directories.
Click to hide internal directories.