core: v2ray.com/core/infra/conf Index | Files | Directories

package conf

import "v2ray.com/core/infra/conf"

Index

Package Files

api.go blackhole.go buildable.go common.go conf.go dns.go dns_proxy.go dokodemo.go errors.generated.go freedom.go http.go loader.go log.go mtproto.go policy.go reverse.go router.go shadowsocks.go socks.go transport.go transport_authenticators.go transport_internet.go trojan.go v2ray.go vless.go vmess.go

Constants

const (
    AuthMethodNoAuth   = "noauth"
    AuthMethodUserPass = "password"
)

func DefaultLogConfig Uses

func DefaultLogConfig() *log.Config

func ParseIP Uses

func ParseIP(s string) (*router.CIDR, error)

func ParseRule Uses

func ParseRule(msg json.RawMessage) (*router.RoutingRule, error)

type Address Uses

type Address struct {
    net.Address
}

func (*Address) Build Uses

func (v *Address) Build() *net.IPOrDomain

func (*Address) UnmarshalJSON Uses

func (v *Address) UnmarshalJSON(data []byte) error

type ApiConfig Uses

type ApiConfig struct {
    Tag      string   `json:"tag"`
    Services []string `json:"services"`
}

func (*ApiConfig) Build Uses

func (c *ApiConfig) Build() (*commander.Config, error)

type AttributeList Uses

type AttributeList struct {
    // contains filtered or unexported fields
}

func (*AttributeList) IsEmpty Uses

func (al *AttributeList) IsEmpty() bool

func (*AttributeList) Match Uses

func (al *AttributeList) Match(domain *router.Domain) bool

type AttributeMatcher Uses

type AttributeMatcher interface {
    Match(*router.Domain) bool
}

type BalancingRule Uses

type BalancingRule struct {
    Tag       string     `json:"tag"`
    Selectors StringList `json:"selector"`
}

func (*BalancingRule) Build Uses

func (r *BalancingRule) Build() (*router.BalancingRule, error)

type BlackholeConfig Uses

type BlackholeConfig struct {
    Response json.RawMessage `json:"response"`
}

func (*BlackholeConfig) Build Uses

func (v *BlackholeConfig) Build() (proto.Message, error)

type BooleanMatcher Uses

type BooleanMatcher string

func (BooleanMatcher) Match Uses

func (m BooleanMatcher) Match(domain *router.Domain) bool

type BridgeConfig Uses

type BridgeConfig struct {
    Tag    string `json:"tag"`
    Domain string `json:"domain"`
}

func (*BridgeConfig) Build Uses

func (c *BridgeConfig) Build() (*reverse.BridgeConfig, error)

type Buildable Uses

type Buildable interface {
    Build() (proto.Message, error)
}

type Config Uses

type Config struct {
    Port            uint16                 `json:"port"` // Port of this Point server. Deprecated.
    LogConfig       *LogConfig             `json:"log"`
    RouterConfig    *RouterConfig          `json:"routing"`
    DNSConfig       *DnsConfig             `json:"dns"`
    InboundConfigs  []InboundDetourConfig  `json:"inbounds"`
    OutboundConfigs []OutboundDetourConfig `json:"outbounds"`
    InboundConfig   *InboundDetourConfig   `json:"inbound"`        // Deprecated.
    OutboundConfig  *OutboundDetourConfig  `json:"outbound"`       // Deprecated.
    InboundDetours  []InboundDetourConfig  `json:"inboundDetour"`  // Deprecated.
    OutboundDetours []OutboundDetourConfig `json:"outboundDetour"` // Deprecated.
    Transport       *TransportConfig       `json:"transport"`
    Policy          *PolicyConfig          `json:"policy"`
    Api             *ApiConfig             `json:"api"`
    Stats           *StatsConfig           `json:"stats"`
    Reverse         *ReverseConfig         `json:"reverse"`
}

func (*Config) Build Uses

func (c *Config) Build() (*core.Config, error)

Build implements Buildable.

func (*Config) Override Uses

func (c *Config) Override(o *Config, fn string)

Override method accepts another Config overrides the current attribute

type ConfigCreator Uses

type ConfigCreator func() interface{}

type ConfigCreatorCache Uses

type ConfigCreatorCache map[string]ConfigCreator

func (ConfigCreatorCache) CreateConfig Uses

func (v ConfigCreatorCache) CreateConfig(id string) (interface{}, error)

func (ConfigCreatorCache) RegisterCreator Uses

func (v ConfigCreatorCache) RegisterCreator(id string, creator ConfigCreator) error

type DTLSAuthenticator Uses

type DTLSAuthenticator struct{}

func (DTLSAuthenticator) Build Uses

func (DTLSAuthenticator) Build() (proto.Message, error)

type DnsConfig Uses

type DnsConfig struct {
    Servers  []*NameServerConfig `json:"servers"`
    Hosts    map[string]*Address `json:"hosts"`
    ClientIP *Address            `json:"clientIp"`
    Tag      string              `json:"tag"`
}

DnsConfig is a JSON serializable object for dns.Config.

func (*DnsConfig) Build Uses

func (c *DnsConfig) Build() (*dns.Config, error)

Build implements Buildable

type DnsOutboundConfig Uses

type DnsOutboundConfig struct {
    Network Network  `json:"network"`
    Address *Address `json:"address"`
    Port    uint16   `json:"port"`
}

func (*DnsOutboundConfig) Build Uses

func (c *DnsOutboundConfig) Build() (proto.Message, error)

type DokodemoConfig Uses

type DokodemoConfig struct {
    Host         *Address     `json:"address"`
    PortValue    uint16       `json:"port"`
    NetworkList  *NetworkList `json:"network"`
    TimeoutValue uint32       `json:"timeout"`
    Redirect     bool         `json:"followRedirect"`
    UserLevel    uint32       `json:"userLevel"`
}

func (*DokodemoConfig) Build Uses

func (v *DokodemoConfig) Build() (proto.Message, error)

type DomainSocketConfig Uses

type DomainSocketConfig struct {
    Path                string `json:"path"`
    Abstract            bool   `json:"abstract"`
    Padding             bool   `json:"padding"`
    AcceptProxyProtocol bool   `json:"acceptProxyProtocol"`
}

func (*DomainSocketConfig) Build Uses

func (c *DomainSocketConfig) Build() (proto.Message, error)

Build implements Buildable.

type FeaturesConfig Uses

type FeaturesConfig struct {
    Detour *VMessDetourConfig `json:"detour"`
}

type FreedomConfig Uses

type FreedomConfig struct {
    DomainStrategy string  `json:"domainStrategy"`
    Timeout        *uint32 `json:"timeout"`
    Redirect       string  `json:"redirect"`
    UserLevel      uint32  `json:"userLevel"`
}

func (*FreedomConfig) Build Uses

func (c *FreedomConfig) Build() (proto.Message, error)

Build implements Buildable

type HTTPAuthenticator Uses

type HTTPAuthenticator struct {
    Request  HTTPAuthenticatorRequest  `json:"request"`
    Response HTTPAuthenticatorResponse `json:"response"`
}

func (*HTTPAuthenticator) Build Uses

func (v *HTTPAuthenticator) Build() (proto.Message, error)

type HTTPAuthenticatorRequest Uses

type HTTPAuthenticatorRequest struct {
    Version string                 `json:"version"`
    Method  string                 `json:"method"`
    Path    StringList             `json:"path"`
    Headers map[string]*StringList `json:"headers"`
}

func (*HTTPAuthenticatorRequest) Build Uses

func (v *HTTPAuthenticatorRequest) Build() (*http.RequestConfig, error)

type HTTPAuthenticatorResponse Uses

type HTTPAuthenticatorResponse struct {
    Version string                 `json:"version"`
    Status  string                 `json:"status"`
    Reason  string                 `json:"reason"`
    Headers map[string]*StringList `json:"headers"`
}

func (*HTTPAuthenticatorResponse) Build Uses

func (v *HTTPAuthenticatorResponse) Build() (*http.ResponseConfig, error)

type HTTPConfig Uses

type HTTPConfig struct {
    Host *StringList `json:"host"`
    Path string      `json:"path"`
}

func (*HTTPConfig) Build Uses

func (c *HTTPConfig) Build() (proto.Message, error)

Build implements Buildable.

type HttpAccount Uses

type HttpAccount struct {
    Username string `json:"user"`
    Password string `json:"pass"`
}

func (*HttpAccount) Build Uses

func (v *HttpAccount) Build() *http.Account

type HttpClientConfig Uses

type HttpClientConfig struct {
    Servers []*HttpRemoteConfig `json:"servers"`
}

func (*HttpClientConfig) Build Uses

func (v *HttpClientConfig) Build() (proto.Message, error)

type HttpRemoteConfig Uses

type HttpRemoteConfig struct {
    Address *Address          `json:"address"`
    Port    uint16            `json:"port"`
    Users   []json.RawMessage `json:"users"`
}

type HttpResponse Uses

type HttpResponse struct{}

func (*HttpResponse) Build Uses

func (*HttpResponse) Build() (proto.Message, error)

type HttpServerConfig Uses

type HttpServerConfig struct {
    Timeout     uint32         `json:"timeout"`
    Accounts    []*HttpAccount `json:"accounts"`
    Transparent bool           `json:"allowTransparent"`
    UserLevel   uint32         `json:"userLevel"`
}

func (*HttpServerConfig) Build Uses

func (c *HttpServerConfig) Build() (proto.Message, error)

type InboundDetourAllocationConfig Uses

type InboundDetourAllocationConfig struct {
    Strategy    string  `json:"strategy"`
    Concurrency *uint32 `json:"concurrency"`
    RefreshMin  *uint32 `json:"refresh"`
}

func (*InboundDetourAllocationConfig) Build Uses

func (c *InboundDetourAllocationConfig) Build() (*proxyman.AllocationStrategy, error)

Build implements Buildable.

type InboundDetourConfig Uses

type InboundDetourConfig struct {
    Protocol       string                         `json:"protocol"`
    PortRange      *PortRange                     `json:"port"`
    ListenOn       *Address                       `json:"listen"`
    Settings       *json.RawMessage               `json:"settings"`
    Tag            string                         `json:"tag"`
    Allocation     *InboundDetourAllocationConfig `json:"allocate"`
    StreamSetting  *StreamConfig                  `json:"streamSettings"`
    DomainOverride *StringList                    `json:"domainOverride"`
    SniffingConfig *SniffingConfig                `json:"sniffing"`
}

func (*InboundDetourConfig) Build Uses

func (c *InboundDetourConfig) Build() (*core.InboundHandlerConfig, error)

Build implements Buildable.

type JSONConfigLoader Uses

type JSONConfigLoader struct {
    // contains filtered or unexported fields
}

func NewJSONConfigLoader Uses

func NewJSONConfigLoader(cache ConfigCreatorCache, idKey string, configKey string) *JSONConfigLoader

func (*JSONConfigLoader) Load Uses

func (v *JSONConfigLoader) Load(raw []byte) (interface{}, string, error)

func (*JSONConfigLoader) LoadWithID Uses

func (v *JSONConfigLoader) LoadWithID(raw []byte, id string) (interface{}, error)

type KCPConfig Uses

type KCPConfig struct {
    Mtu             *uint32         `json:"mtu"`
    Tti             *uint32         `json:"tti"`
    UpCap           *uint32         `json:"uplinkCapacity"`
    DownCap         *uint32         `json:"downlinkCapacity"`
    Congestion      *bool           `json:"congestion"`
    ReadBufferSize  *uint32         `json:"readBufferSize"`
    WriteBufferSize *uint32         `json:"writeBufferSize"`
    HeaderConfig    json.RawMessage `json:"header"`
    Seed            *string         `json:"seed"`
}

func (*KCPConfig) Build Uses

func (c *KCPConfig) Build() (proto.Message, error)

Build implements Buildable.

type LogConfig Uses

type LogConfig struct {
    AccessLog string `json:"access"`
    ErrorLog  string `json:"error"`
    LogLevel  string `json:"loglevel"`
}

func (*LogConfig) Build Uses

func (v *LogConfig) Build() *log.Config

type MTProtoAccount Uses

type MTProtoAccount struct {
    Secret string `json:"secret"`
}

func (*MTProtoAccount) Build Uses

func (a *MTProtoAccount) Build() (*mtproto.Account, error)

Build implements Buildable

type MTProtoClientConfig Uses

type MTProtoClientConfig struct {
}

func (*MTProtoClientConfig) Build Uses

func (c *MTProtoClientConfig) Build() (proto.Message, error)

type MTProtoServerConfig Uses

type MTProtoServerConfig struct {
    Users []json.RawMessage `json:"users"`
}

func (*MTProtoServerConfig) Build Uses

func (c *MTProtoServerConfig) Build() (proto.Message, error)

type MuxConfig Uses

type MuxConfig struct {
    Enabled     bool  `json:"enabled"`
    Concurrency int16 `json:"concurrency"`
}

func (*MuxConfig) Build Uses

func (m *MuxConfig) Build() *proxyman.MultiplexingConfig

Build creates MultiplexingConfig, Concurrency < 0 completely disables mux.

type NameServerConfig Uses

type NameServerConfig struct {
    Address   *Address
    Port      uint16
    Domains   []string
    ExpectIPs StringList
}

func (*NameServerConfig) Build Uses

func (c *NameServerConfig) Build() (*dns.NameServer, error)

func (*NameServerConfig) UnmarshalJSON Uses

func (c *NameServerConfig) UnmarshalJSON(data []byte) error

type Network Uses

type Network string

func (Network) Build Uses

func (v Network) Build() net.Network

type NetworkList Uses

type NetworkList []Network

func (*NetworkList) Build Uses

func (v *NetworkList) Build() []net.Network

func (*NetworkList) UnmarshalJSON Uses

func (v *NetworkList) UnmarshalJSON(data []byte) error

type NoOpAuthenticator Uses

type NoOpAuthenticator struct{}

func (NoOpAuthenticator) Build Uses

func (NoOpAuthenticator) Build() (proto.Message, error)

type NoOpConnectionAuthenticator Uses

type NoOpConnectionAuthenticator struct{}

func (NoOpConnectionAuthenticator) Build Uses

func (NoOpConnectionAuthenticator) Build() (proto.Message, error)

type NoneResponse Uses

type NoneResponse struct{}

func (*NoneResponse) Build Uses

func (*NoneResponse) Build() (proto.Message, error)

type OutboundDetourConfig Uses

type OutboundDetourConfig struct {
    Protocol      string           `json:"protocol"`
    SendThrough   *Address         `json:"sendThrough"`
    Tag           string           `json:"tag"`
    Settings      *json.RawMessage `json:"settings"`
    StreamSetting *StreamConfig    `json:"streamSettings"`
    ProxySettings *ProxyConfig     `json:"proxySettings"`
    MuxSettings   *MuxConfig       `json:"mux"`
}

func (*OutboundDetourConfig) Build Uses

func (c *OutboundDetourConfig) Build() (*core.OutboundHandlerConfig, error)

Build implements Buildable.

type Policy Uses

type Policy struct {
    Handshake         *uint32 `json:"handshake"`
    ConnectionIdle    *uint32 `json:"connIdle"`
    UplinkOnly        *uint32 `json:"uplinkOnly"`
    DownlinkOnly      *uint32 `json:"downlinkOnly"`
    StatsUserUplink   bool    `json:"statsUserUplink"`
    StatsUserDownlink bool    `json:"statsUserDownlink"`
    BufferSize        *int32  `json:"bufferSize"`
}

func (*Policy) Build Uses

func (t *Policy) Build() (*policy.Policy, error)

type PolicyConfig Uses

type PolicyConfig struct {
    Levels map[uint32]*Policy `json:"levels"`
    System *SystemPolicy      `json:"system"`
}

func (*PolicyConfig) Build Uses

func (c *PolicyConfig) Build() (*policy.Config, error)

type PortList Uses

type PortList struct {
    Range []PortRange
}

func (*PortList) Build Uses

func (list *PortList) Build() *net.PortList

func (*PortList) UnmarshalJSON Uses

func (list *PortList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements encoding/json.Unmarshaler.UnmarshalJSON

type PortRange Uses

type PortRange struct {
    From uint32
    To   uint32
}

func (*PortRange) Build Uses

func (v *PortRange) Build() *net.PortRange

func (*PortRange) UnmarshalJSON Uses

func (v *PortRange) UnmarshalJSON(data []byte) error

UnmarshalJSON implements encoding/json.Unmarshaler.UnmarshalJSON

type PortalConfig Uses

type PortalConfig struct {
    Tag    string `json:"tag"`
    Domain string `json:"domain"`
}

func (*PortalConfig) Build Uses

func (c *PortalConfig) Build() (*reverse.PortalConfig, error)

type ProxyConfig Uses

type ProxyConfig struct {
    Tag string `json:"tag"`
}

func (*ProxyConfig) Build Uses

func (v *ProxyConfig) Build() (*internet.ProxyConfig, error)

Build implements Buildable.

type QUICConfig Uses

type QUICConfig struct {
    Header   json.RawMessage `json:"header"`
    Security string          `json:"security"`
    Key      string          `json:"key"`
}

func (*QUICConfig) Build Uses

func (c *QUICConfig) Build() (proto.Message, error)

Build implements Buildable.

type ReverseConfig Uses

type ReverseConfig struct {
    Bridges []BridgeConfig `json:"bridges"`
    Portals []PortalConfig `json:"portals"`
}

func (*ReverseConfig) Build Uses

func (c *ReverseConfig) Build() (proto.Message, error)

type RouterConfig Uses

type RouterConfig struct {
    Settings       *RouterRulesConfig `json:"settings"` // Deprecated
    RuleList       []json.RawMessage  `json:"rules"`
    DomainStrategy *string            `json:"domainStrategy"`
    Balancers      []*BalancingRule   `json:"balancers"`
}

func (*RouterConfig) Build Uses

func (c *RouterConfig) Build() (*router.Config, error)

type RouterRule Uses

type RouterRule struct {
    Type        string `json:"type"`
    OutboundTag string `json:"outboundTag"`
    BalancerTag string `json:"balancerTag"`
}

type RouterRulesConfig Uses

type RouterRulesConfig struct {
    RuleList       []json.RawMessage `json:"rules"`
    DomainStrategy string            `json:"domainStrategy"`
}

type SRTPAuthenticator Uses

type SRTPAuthenticator struct{}

func (SRTPAuthenticator) Build Uses

func (SRTPAuthenticator) Build() (proto.Message, error)

type ShadowsocksClientConfig Uses

type ShadowsocksClientConfig struct {
    Servers []*ShadowsocksServerTarget `json:"servers"`
}

func (*ShadowsocksClientConfig) Build Uses

func (v *ShadowsocksClientConfig) Build() (proto.Message, error)

type ShadowsocksServerConfig Uses

type ShadowsocksServerConfig struct {
    Cipher      string       `json:"method"`
    Password    string       `json:"password"`
    UDP         bool         `json:"udp"`
    Level       byte         `json:"level"`
    Email       string       `json:"email"`
    NetworkList *NetworkList `json:"network"`
}

func (*ShadowsocksServerConfig) Build Uses

func (v *ShadowsocksServerConfig) Build() (proto.Message, error)

type ShadowsocksServerTarget Uses

type ShadowsocksServerTarget struct {
    Address  *Address `json:"address"`
    Port     uint16   `json:"port"`
    Cipher   string   `json:"method"`
    Password string   `json:"password"`
    Email    string   `json:"email"`
    Ota      bool     `json:"ota"`
    Level    byte     `json:"level"`
}

type SniffingConfig Uses

type SniffingConfig struct {
    Enabled      bool        `json:"enabled"`
    DestOverride *StringList `json:"destOverride"`
}

func (*SniffingConfig) Build Uses

func (c *SniffingConfig) Build() (*proxyman.SniffingConfig, error)

Build implements Buildable.

type SocketConfig Uses

type SocketConfig struct {
    Mark   int32  `json:"mark"`
    TFO    *bool  `json:"tcpFastOpen"`
    TProxy string `json:"tproxy"`
}

func (*SocketConfig) Build Uses

func (c *SocketConfig) Build() (*internet.SocketConfig, error)

Build implements Buildable.

type SocksAccount Uses

type SocksAccount struct {
    Username string `json:"user"`
    Password string `json:"pass"`
}

func (*SocksAccount) Build Uses

func (v *SocksAccount) Build() *socks.Account

type SocksClientConfig Uses

type SocksClientConfig struct {
    Servers []*SocksRemoteConfig `json:"servers"`
}

func (*SocksClientConfig) Build Uses

func (v *SocksClientConfig) Build() (proto.Message, error)

type SocksRemoteConfig Uses

type SocksRemoteConfig struct {
    Address *Address          `json:"address"`
    Port    uint16            `json:"port"`
    Users   []json.RawMessage `json:"users"`
}

type SocksServerConfig Uses

type SocksServerConfig struct {
    AuthMethod string          `json:"auth"`
    Accounts   []*SocksAccount `json:"accounts"`
    UDP        bool            `json:"udp"`
    Host       *Address        `json:"ip"`
    Timeout    uint32          `json:"timeout"`
    UserLevel  uint32          `json:"userLevel"`
}

func (*SocksServerConfig) Build Uses

func (v *SocksServerConfig) Build() (proto.Message, error)

type StatsConfig Uses

type StatsConfig struct{}

func (*StatsConfig) Build Uses

func (c *StatsConfig) Build() (*stats.Config, error)

Build implements Buildable.

type StreamConfig Uses

type StreamConfig struct {
    Network        *TransportProtocol  `json:"network"`
    Security       string              `json:"security"`
    TLSSettings    *TLSConfig          `json:"tlsSettings"`
    XTLSSettings   *XTLSConfig         `json:"xtlsSettings"`
    TCPSettings    *TCPConfig          `json:"tcpSettings"`
    KCPSettings    *KCPConfig          `json:"kcpSettings"`
    WSSettings     *WebSocketConfig    `json:"wsSettings"`
    HTTPSettings   *HTTPConfig         `json:"httpSettings"`
    DSSettings     *DomainSocketConfig `json:"dsSettings"`
    QUICSettings   *QUICConfig         `json:"quicSettings"`
    SocketSettings *SocketConfig       `json:"sockopt"`
}

func (*StreamConfig) Build Uses

func (c *StreamConfig) Build() (*internet.StreamConfig, error)

Build implements Buildable.

type StringList Uses

type StringList []string

func NewStringList Uses

func NewStringList(raw []string) *StringList

func (StringList) Len Uses

func (v StringList) Len() int

func (*StringList) UnmarshalJSON Uses

func (v *StringList) UnmarshalJSON(data []byte) error

type SystemPolicy Uses

type SystemPolicy struct {
    StatsInboundUplink    bool `json:"statsInboundUplink"`
    StatsInboundDownlink  bool `json:"statsInboundDownlink"`
    StatsOutboundUplink   bool `json:"statsOutboundUplink"`
    StatsOutboundDownlink bool `json:"statsOutboundDownlink"`
}

func (*SystemPolicy) Build Uses

func (p *SystemPolicy) Build() (*policy.SystemPolicy, error)

type TCPConfig Uses

type TCPConfig struct {
    HeaderConfig        json.RawMessage `json:"header"`
    AcceptProxyProtocol bool            `json:"acceptProxyProtocol"`
}

func (*TCPConfig) Build Uses

func (c *TCPConfig) Build() (proto.Message, error)

Build implements Buildable.

type TLSCertConfig Uses

type TLSCertConfig struct {
    CertFile string   `json:"certificateFile"`
    CertStr  []string `json:"certificate"`
    KeyFile  string   `json:"keyFile"`
    KeyStr   []string `json:"key"`
    Usage    string   `json:"usage"`
}

func (*TLSCertConfig) Build Uses

func (c *TLSCertConfig) Build() (*tls.Certificate, error)

Build implements Buildable.

type TLSConfig Uses

type TLSConfig struct {
    Insecure                 bool             `json:"allowInsecure"`
    InsecureCiphers          bool             `json:"allowInsecureCiphers"`
    Certs                    []*TLSCertConfig `json:"certificates"`
    ServerName               string           `json:"serverName"`
    ALPN                     *StringList      `json:"alpn"`
    DisableSessionResumption bool             `json:"disableSessionResumption"`
    DisableSystemRoot        bool             `json:"disableSystemRoot"`
}

func (*TLSConfig) Build Uses

func (c *TLSConfig) Build() (proto.Message, error)

Build implements Buildable.

type TransportConfig Uses

type TransportConfig struct {
    TCPConfig  *TCPConfig          `json:"tcpSettings"`
    KCPConfig  *KCPConfig          `json:"kcpSettings"`
    WSConfig   *WebSocketConfig    `json:"wsSettings"`
    HTTPConfig *HTTPConfig         `json:"httpSettings"`
    DSConfig   *DomainSocketConfig `json:"dsSettings"`
    QUICConfig *QUICConfig         `json:"quicSettings"`
}

func (*TransportConfig) Build Uses

func (c *TransportConfig) Build() (*transport.Config, error)

Build implements Buildable.

type TransportProtocol Uses

type TransportProtocol string

func (TransportProtocol) Build Uses

func (p TransportProtocol) Build() (string, error)

Build implements Buildable.

type TrojanClientConfig Uses

type TrojanClientConfig struct {
    Servers []*TrojanServerTarget `json:"servers"`
}

TrojanClientConfig is configuration of trojan servers

func (*TrojanClientConfig) Build Uses

func (c *TrojanClientConfig) Build() (proto.Message, error)

Build implements Buildable

type TrojanInboundFallback Uses

type TrojanInboundFallback struct {
    Alpn string          `json:"alpn"`
    Path string          `json:"path"`
    Type string          `json:"type"`
    Dest json.RawMessage `json:"dest"`
    Xver uint64          `json:"xver"`
}

TrojanInboundFallback is fallback configuration

type TrojanServerConfig Uses

type TrojanServerConfig struct {
    Clients   []*TrojanUserConfig      `json:"clients"`
    Fallback  json.RawMessage          `json:"fallback"`
    Fallbacks []*TrojanInboundFallback `json:"fallbacks"`
}

TrojanServerConfig is Inbound configuration

func (*TrojanServerConfig) Build Uses

func (c *TrojanServerConfig) Build() (proto.Message, error)

Build implements Buildable

type TrojanServerTarget Uses

type TrojanServerTarget struct {
    Address  *Address `json:"address"`
    Port     uint16   `json:"port"`
    Password string   `json:"password"`
    Email    string   `json:"email"`
    Level    byte     `json:"level"`
}

TrojanServerTarget is configuration of a single trojan server

type TrojanUserConfig Uses

type TrojanUserConfig struct {
    Password string `json:"password"`
    Level    byte   `json:"level"`
    Email    string `json:"email"`
}

TrojanUserConfig is user configuration

type UTPAuthenticator Uses

type UTPAuthenticator struct{}

func (UTPAuthenticator) Build Uses

func (UTPAuthenticator) Build() (proto.Message, error)

type User Uses

type User struct {
    EmailString string `json:"email"`
    LevelByte   byte   `json:"level"`
}

func (*User) Build Uses

func (v *User) Build() *protocol.User

type VLessInboundConfig Uses

type VLessInboundConfig struct {
    Clients    []json.RawMessage       `json:"clients"`
    Decryption string                  `json:"decryption"`
    Fallback   json.RawMessage         `json:"fallback"`
    Fallbacks  []*VLessInboundFallback `json:"fallbacks"`
}

func (*VLessInboundConfig) Build Uses

func (c *VLessInboundConfig) Build() (proto.Message, error)

Build implements Buildable

type VLessInboundFallback Uses

type VLessInboundFallback struct {
    Alpn string          `json:"alpn"`
    Path string          `json:"path"`
    Type string          `json:"type"`
    Dest json.RawMessage `json:"dest"`
    Xver uint64          `json:"xver"`
}

type VLessOutboundConfig Uses

type VLessOutboundConfig struct {
    Vnext []*VLessOutboundVnext `json:"vnext"`
}

func (*VLessOutboundConfig) Build Uses

func (c *VLessOutboundConfig) Build() (proto.Message, error)

Build implements Buildable

type VLessOutboundVnext Uses

type VLessOutboundVnext struct {
    Address *Address          `json:"address"`
    Port    uint16            `json:"port"`
    Users   []json.RawMessage `json:"users"`
}

type VMessAccount Uses

type VMessAccount struct {
    ID       string `json:"id"`
    AlterIds uint16 `json:"alterId"`
    Security string `json:"security"`
}

func (*VMessAccount) Build Uses

func (a *VMessAccount) Build() *vmess.Account

Build implements Buildable

type VMessDefaultConfig Uses

type VMessDefaultConfig struct {
    AlterIDs uint16 `json:"alterId"`
    Level    byte   `json:"level"`
}

func (*VMessDefaultConfig) Build Uses

func (c *VMessDefaultConfig) Build() *inbound.DefaultConfig

Build implements Buildable

type VMessDetourConfig Uses

type VMessDetourConfig struct {
    ToTag string `json:"to"`
}

func (*VMessDetourConfig) Build Uses

func (c *VMessDetourConfig) Build() *inbound.DetourConfig

Build implements Buildable

type VMessInboundConfig Uses

type VMessInboundConfig struct {
    Users        []json.RawMessage   `json:"clients"`
    Features     *FeaturesConfig     `json:"features"`
    Defaults     *VMessDefaultConfig `json:"default"`
    DetourConfig *VMessDetourConfig  `json:"detour"`
    SecureOnly   bool                `json:"disableInsecureEncryption"`
}

func (*VMessInboundConfig) Build Uses

func (c *VMessInboundConfig) Build() (proto.Message, error)

Build implements Buildable

type VMessOutboundConfig Uses

type VMessOutboundConfig struct {
    Receivers []*VMessOutboundTarget `json:"vnext"`
}

func (*VMessOutboundConfig) Build Uses

func (c *VMessOutboundConfig) Build() (proto.Message, error)

Build implements Buildable

type VMessOutboundTarget Uses

type VMessOutboundTarget struct {
    Address *Address          `json:"address"`
    Port    uint16            `json:"port"`
    Users   []json.RawMessage `json:"users"`
}

type WebSocketConfig Uses

type WebSocketConfig struct {
    Path                string            `json:"path"`
    Path2               string            `json:"Path"` // The key was misspelled. For backward compatibility, we have to keep track the old key.
    Headers             map[string]string `json:"headers"`
    AcceptProxyProtocol bool              `json:"acceptProxyProtocol"`
}

func (*WebSocketConfig) Build Uses

func (c *WebSocketConfig) Build() (proto.Message, error)

Build implements Buildable.

type WechatVideoAuthenticator Uses

type WechatVideoAuthenticator struct{}

func (WechatVideoAuthenticator) Build Uses

func (WechatVideoAuthenticator) Build() (proto.Message, error)

type WireguardAuthenticator Uses

type WireguardAuthenticator struct{}

func (WireguardAuthenticator) Build Uses

func (WireguardAuthenticator) Build() (proto.Message, error)

type XTLSCertConfig Uses

type XTLSCertConfig struct {
    CertFile string   `json:"certificateFile"`
    CertStr  []string `json:"certificate"`
    KeyFile  string   `json:"keyFile"`
    KeyStr   []string `json:"key"`
    Usage    string   `json:"usage"`
}

func (*XTLSCertConfig) Build Uses

func (c *XTLSCertConfig) Build() (*xtls.Certificate, error)

Build implements Buildable.

type XTLSConfig Uses

type XTLSConfig struct {
    Insecure                 bool              `json:"allowInsecure"`
    InsecureCiphers          bool              `json:"allowInsecureCiphers"`
    Certs                    []*XTLSCertConfig `json:"certificates"`
    ServerName               string            `json:"serverName"`
    ALPN                     *StringList       `json:"alpn"`
    DisableSessionResumption bool              `json:"disableSessionResumption"`
    DisableSystemRoot        bool              `json:"disableSystemRoot"`
}

func (*XTLSConfig) Build Uses

func (c *XTLSConfig) Build() (proto.Message, error)

Build implements Buildable.

Directories

PathSynopsis
command
json
serial

Package conf imports 62 packages (graph) and is imported by 15 packages. Updated 2020-10-14. Refresh now. Tools for package owners.