Documentation ¶
Index ¶
- Constants
- func DefaultLogConfig() *log.Config
- func PostProcessConfigureFile(conf *Config) error
- func RegisterConfigureFilePostProcessingStage(name string, stage ConfigureFilePostProcessingStage)
- type APIConfig
- type Authenticator
- type AuthenticatorRequest
- type AuthenticatorResponse
- type BalancingRule
- type BlackholeConfig
- type BridgeConfig
- type BrowserForwarderConfig
- type Buildable
- type Config
- type ConfigCreator
- type ConfigCreatorCache
- type ConfigureFilePostProcessingStage
- type DNSConfig
- type DNSOutboundConfig
- type DTLSAuthenticator
- type DokodemoConfig
- type DomainSocketConfig
- type FakeDNSConfig
- type FakeDNSPoolElementConfig
- type FakeDNSPostProcessingStage
- type FeaturesConfig
- type FreedomConfig
- type GunConfig
- type HTTPAccount
- type HTTPClientConfig
- type HTTPConfig
- type HTTPRemoteConfig
- type HTTPResponse
- type HTTPServerConfig
- type HostAddress
- type InboundDetourAllocationConfig
- type InboundDetourConfig
- type JSONConfigLoader
- type KCPConfig
- type LogConfig
- type LoopbackConfig
- type MuxConfig
- type NameServerConfig
- type NoOpAuthenticator
- type NoOpConnectionAuthenticator
- type NoneResponse
- type ObservatoryConfig
- type OutboundDetourConfig
- type Policy
- type PolicyConfig
- type PortalConfig
- type ProxyConfig
- type QUICConfig
- type ReverseConfig
- type RouterConfig
- type RouterRulesConfig
- type SRTPAuthenticator
- type ShadowsocksClientConfig
- type ShadowsocksServerConfig
- type ShadowsocksServerTarget
- type SniffingConfig
- type SocketConfig
- type SocksAccount
- type SocksClientConfig
- type SocksRemoteConfig
- type SocksServerConfig
- type StatsConfig
- type StrategyConfig
- type StreamConfig
- type SystemPolicy
- type TCPConfig
- type TLSCertConfig
- type TLSConfig
- type TransportConfig
- type TransportProtocol
- type TrojanClientConfig
- type TrojanInboundFallback
- type TrojanServerConfig
- type TrojanServerTarget
- type TrojanUserConfig
- type UTPAuthenticator
- type VMessAccount
- type VMessDefaultConfig
- type VMessDetourConfig
- type VMessInboundConfig
- type VMessOutboundConfig
- type WebSocketConfig
- type WechatVideoAuthenticator
- type WireguardAuthenticator
Constants ¶
const ( AuthMethodNoAuth = "noauth" AuthMethodUserPass = "password" )
Variables ¶
This section is empty.
Functions ¶
func DefaultLogConfig ¶
func RegisterConfigureFilePostProcessingStage ¶
func RegisterConfigureFilePostProcessingStage(name string, stage ConfigureFilePostProcessingStage)
Types ¶
type Authenticator ¶
type Authenticator struct { Request AuthenticatorRequest `json:"request"` Response AuthenticatorResponse `json:"response"` }
type AuthenticatorRequest ¶
type AuthenticatorRequest struct { Version string `json:"version"` Method string `json:"method"` Path cfgcommon.StringList `json:"path"` Headers map[string]*cfgcommon.StringList `json:"headers"` }
func (*AuthenticatorRequest) Build ¶
func (v *AuthenticatorRequest) Build() (*http.RequestConfig, error)
type AuthenticatorResponse ¶
type AuthenticatorResponse struct { Version string `json:"version"` Status string `json:"status"` Reason string `json:"reason"` Headers map[string]*cfgcommon.StringList `json:"headers"` }
func (*AuthenticatorResponse) Build ¶
func (v *AuthenticatorResponse) Build() (*http.ResponseConfig, error)
type BalancingRule ¶
type BalancingRule struct { Tag string `json:"tag"` Selectors cfgcommon.StringList `json:"selector"` Strategy StrategyConfig `json:"strategy"` }
func (*BalancingRule) Build ¶
func (r *BalancingRule) Build() (*router.BalancingRule, error)
type BlackholeConfig ¶
type BlackholeConfig struct {
Response json.RawMessage `json:"response"`
}
type BridgeConfig ¶
func (*BridgeConfig) Build ¶
func (c *BridgeConfig) Build() (*reverse.BridgeConfig, error)
type BrowserForwarderConfig ¶
type Config ¶
type Config struct { // Port of this Point server. // Deprecated: Port exists for historical compatibility // and should not be used. Port uint16 `json:"port"` LogConfig *LogConfig `json:"log"` RouterConfig *RouterConfig `json:"routing"` DNSConfig *DNSConfig `json:"dns"` InboundConfigs []InboundDetourConfig `json:"inbounds"` OutboundConfigs []OutboundDetourConfig `json:"outbounds"` Transport *TransportConfig `json:"transport"` Policy *PolicyConfig `json:"policy"` API *APIConfig `json:"api"` Stats *StatsConfig `json:"stats"` Reverse *ReverseConfig `json:"reverse"` FakeDNS *FakeDNSConfig `json:"fakeDns"` BrowserForwarder *BrowserForwarderConfig `json:"browserForwarder"` Observatory *ObservatoryConfig `json:"observatory"` Services map[string]*json.RawMessage `json:"services"` }
func (*Config) BuildServices ¶
func (c *Config) BuildServices(service map[string]*json.RawMessage) ([]*serial.TypedMessage, error)
type ConfigCreator ¶
type ConfigCreator func() interface{}
type ConfigCreatorCache ¶
type ConfigCreatorCache map[string]ConfigCreator
func (ConfigCreatorCache) CreateConfig ¶
func (v ConfigCreatorCache) CreateConfig(id string) (interface{}, error)
func (ConfigCreatorCache) RegisterCreator ¶
func (v ConfigCreatorCache) RegisterCreator(id string, creator ConfigCreator) error
type DNSConfig ¶
type DNSConfig struct { Servers []*NameServerConfig `json:"servers"` Hosts map[string]*HostAddress `json:"hosts"` ClientIP *cfgcommon.Address `json:"clientIp"` Tag string `json:"tag"` QueryStrategy string `json:"queryStrategy"` DisableCache bool `json:"disableCache"` DisableFallback bool `json:"disableFallback"` DisableFallbackIfMatch bool `json:"disableFallbackIfMatch"` }
DNSConfig is a JSON serializable object for dns.Config.
type DNSOutboundConfig ¶
type DTLSAuthenticator ¶
type DTLSAuthenticator struct{}
type DokodemoConfig ¶
type DomainSocketConfig ¶
type FakeDNSConfig ¶
type FakeDNSConfig struct {
// contains filtered or unexported fields
}
func (*FakeDNSConfig) Build ¶
func (f *FakeDNSConfig) Build() (*fakedns.FakeDnsPoolMulti, error)
func (*FakeDNSConfig) UnmarshalJSON ¶
func (f *FakeDNSConfig) UnmarshalJSON(data []byte) error
UnmarshalJSON implements encoding/json.Unmarshaler.UnmarshalJSON
type FakeDNSPostProcessingStage ¶
type FakeDNSPostProcessingStage struct{}
func (FakeDNSPostProcessingStage) Process ¶
func (FakeDNSPostProcessingStage) Process(config *Config) error
type FeaturesConfig ¶
type FeaturesConfig struct {
Detour *VMessDetourConfig `json:"detour"`
}
type FreedomConfig ¶
type HTTPAccount ¶
func (*HTTPAccount) Build ¶
func (v *HTTPAccount) Build() *http.Account
type HTTPClientConfig ¶
type HTTPClientConfig struct {
Servers []*HTTPRemoteConfig `json:"servers"`
}
type HTTPConfig ¶
type HTTPConfig struct { Host *cfgcommon.StringList `json:"host"` Path string `json:"path"` Method string `json:"method"` Headers map[string]*cfgcommon.StringList `json:"headers"` }
type HTTPRemoteConfig ¶
type HTTPRemoteConfig struct { Address *cfgcommon.Address `json:"address"` Port uint16 `json:"port"` Users []json.RawMessage `json:"users"` }
type HTTPResponse ¶
type HTTPResponse struct{}
type HTTPServerConfig ¶
type HTTPServerConfig struct { Timeout uint32 `json:"timeout"` Accounts []*HTTPAccount `json:"accounts"` Transparent bool `json:"allowTransparent"` UserLevel uint32 `json:"userLevel"` }
type HostAddress ¶
type HostAddress struct {
// contains filtered or unexported fields
}
func (*HostAddress) UnmarshalJSON ¶
func (h *HostAddress) UnmarshalJSON(data []byte) error
UnmarshalJSON implements encoding/json.Unmarshaler.UnmarshalJSON
type InboundDetourAllocationConfig ¶
type InboundDetourAllocationConfig struct { Strategy string `json:"strategy"` Concurrency *uint32 `json:"concurrency"` RefreshMin *uint32 `json:"refresh"` }
func (*InboundDetourAllocationConfig) Build ¶
func (c *InboundDetourAllocationConfig) Build() (*proxyman.AllocationStrategy, error)
Build implements Buildable.
type InboundDetourConfig ¶
type InboundDetourConfig struct { Protocol string `json:"protocol"` PortRange *cfgcommon.PortRange `json:"port"` ListenOn *cfgcommon.Address `json:"listen"` Settings *json.RawMessage `json:"settings"` Tag string `json:"tag"` Allocation *InboundDetourAllocationConfig `json:"allocate"` StreamSetting *StreamConfig `json:"streamSettings"` DomainOverride *cfgcommon.StringList `json:"domainOverride"` SniffingConfig *SniffingConfig `json:"sniffing"` }
func (*InboundDetourConfig) Build ¶
func (c *InboundDetourConfig) Build() (*core.InboundHandlerConfig, error)
Build implements Buildable.
type JSONConfigLoader ¶
type JSONConfigLoader struct {
// contains filtered or unexported fields
}
func NewJSONConfigLoader ¶
func NewJSONConfigLoader(cache ConfigCreatorCache, idKey string, configKey string) *JSONConfigLoader
func (*JSONConfigLoader) Load ¶
func (v *JSONConfigLoader) Load(raw []byte) (interface{}, string, error)
func (*JSONConfigLoader) LoadWithID ¶
func (v *JSONConfigLoader) LoadWithID(raw []byte, id string) (interface{}, error)
type KCPConfig ¶
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"` }
type LogConfig ¶
type LoopbackConfig ¶
type LoopbackConfig struct {
InboundTag string `json:"inboundTag"`
}
type MuxConfig ¶
func (*MuxConfig) Build ¶
func (m *MuxConfig) Build() *proxyman.MultiplexingConfig
Build creates MultiplexingConfig, Concurrency < 0 completely disables mux.
type NameServerConfig ¶
type NameServerConfig struct { Address *cfgcommon.Address ClientIP *cfgcommon.Address Port uint16 SkipFallback bool Domains []string ExpectIPs cfgcommon.StringList // contains filtered or unexported fields }
func (*NameServerConfig) Build ¶
func (c *NameServerConfig) Build() (*dns.NameServer, error)
func (*NameServerConfig) UnmarshalJSON ¶
func (c *NameServerConfig) UnmarshalJSON(data []byte) error
type NoOpAuthenticator ¶
type NoOpAuthenticator struct{}
type NoOpConnectionAuthenticator ¶
type NoOpConnectionAuthenticator struct{}
type NoneResponse ¶
type NoneResponse struct{}
type ObservatoryConfig ¶
type OutboundDetourConfig ¶
type OutboundDetourConfig struct { Protocol string `json:"protocol"` // Name of the network interface to bind. BindInterface string `json:"bindInterface"` // Bind to an IPv4 address or the IPv4 address of an interface. // When an interface is specified, the address is a domain. Bind4 *cfgcommon.Address `json:"bind4"` // Bind to an IPv6 address or the IPv6 address of an interface. // When an interface is specified, the address is a domain. Bind6 *cfgcommon.Address `json:"bind6"` // LinuxBindInterfaceUDPUsePktinfo controls when binding a UDP socket to an interface, // whether the IP(V6)_PKTINFO socket control message should be used instead of // the SO_BINDTODEVICE socket option. LinuxBindInterfaceUDPUsePktinfo bool `json:"linuxBindInterfaceUDPUsePktinfo"` // DomainStrategy controls how domain dial targets are processed. DomainStrategy string `json:"domainStrategy"` // FallbackDelayMs controls the RFC 6555 happy eyeballs fast fallback delay in milliseconds. FallbackDelayMs int32 `json:"fallbackDelayMs"` Tag string `json:"tag"` Settings *json.RawMessage `json:"settings"` StreamSetting *StreamConfig `json:"streamSettings"` ProxySettings *ProxyConfig `json:"proxySettings"` MuxSettings *MuxConfig `json:"mux"` }
func (*OutboundDetourConfig) Build ¶
func (c *OutboundDetourConfig) Build() (*core.OutboundHandlerConfig, error)
Build implements Buildable. nolint: gocritic
type Policy ¶
type Policy struct { Handshake *uint32 `json:"handshake"` UDPTimeout *uint32 `json:"udpTimeout"` UplinkOnly *uint32 `json:"uplinkOnly"` DownlinkOnly *uint32 `json:"downlinkOnly"` StatsUserUplink bool `json:"statsUserUplink"` StatsUserDownlink bool `json:"statsUserDownlink"` BufferSize *int32 `json:"bufferSize"` }
type PolicyConfig ¶
type PolicyConfig struct { Levels map[uint32]*Policy `json:"levels"` System *SystemPolicy `json:"system"` }
type PortalConfig ¶
func (*PortalConfig) Build ¶
func (c *PortalConfig) Build() (*reverse.PortalConfig, error)
type ProxyConfig ¶
type ProxyConfig struct { Tag string `json:"tag"` TransportLayerProxy bool `json:"transportLayer"` }
func (*ProxyConfig) Build ¶
func (v *ProxyConfig) Build() (*internet.ProxyConfig, error)
Build implements Buildable.
type QUICConfig ¶
type QUICConfig struct { Header json.RawMessage `json:"header"` Security string `json:"security"` Key string `json:"key"` }
type ReverseConfig ¶
type ReverseConfig struct { Bridges []BridgeConfig `json:"bridges"` Portals []PortalConfig `json:"portals"` }
type RouterConfig ¶
type RouterConfig struct { Settings *RouterRulesConfig `json:"settings"` // Deprecated RuleList []json.RawMessage `json:"rules"` DomainStrategy *string `json:"domainStrategy"` Balancers []*BalancingRule `json:"balancers"` DomainMatcher string `json:"domainMatcher"` }
type RouterRulesConfig ¶
type RouterRulesConfig struct { RuleList []json.RawMessage `json:"rules"` DomainStrategy string `json:"domainStrategy"` }
type SRTPAuthenticator ¶
type SRTPAuthenticator struct{}
type ShadowsocksClientConfig ¶
type ShadowsocksClientConfig struct {
Servers []*ShadowsocksServerTarget `json:"servers"`
}
type ShadowsocksServerConfig ¶
type ShadowsocksServerTarget ¶
type SniffingConfig ¶
type SniffingConfig struct { Enabled bool `json:"enabled"` DestOverride *cfgcommon.StringList `json:"destOverride"` MetadataOnly bool `json:"metadataOnly"` RouteOnly bool `json:"routeOnly"` SkipDomainDestinations bool `json:"skipDomainDestinations"` SkippedDomains []string `json:"skippedDomains"` }
func (*SniffingConfig) Build ¶
func (c *SniffingConfig) Build() (*proxyman.SniffingConfig, error)
Build implements Buildable.
type SocketConfig ¶
type SocketConfig struct { Mark uint32 `json:"mark"` TFO *bool `json:"tcpFastOpen"` TFOQueueLength uint32 `json:"tcpFastOpenQueueLength"` TProxy string `json:"tproxy"` AcceptProxyProtocol bool `json:"acceptProxyProtocol"` TCPKeepAliveInterval int32 `json:"tcpKeepAliveInterval"` }
func (*SocketConfig) Build ¶
func (c *SocketConfig) Build() (*internet.SocketConfig, error)
Build implements Buildable.
type SocksAccount ¶
func (*SocksAccount) Build ¶
func (v *SocksAccount) Build() *socks.Account
type SocksClientConfig ¶
type SocksClientConfig struct {
Servers []*SocksRemoteConfig `json:"servers"`
}
type SocksRemoteConfig ¶
type SocksRemoteConfig struct { Address *cfgcommon.Address `json:"address"` Port uint16 `json:"port"` Users []json.RawMessage `json:"users"` }
type SocksServerConfig ¶
type StatsConfig ¶
type StatsConfig struct{}
type StrategyConfig ¶
type StrategyConfig struct { Type string `json:"type"` Settings *json.RawMessage `json:"settings"` }
StrategyConfig represents a strategy config
type StreamConfig ¶
type StreamConfig struct { Network *TransportProtocol `json:"network"` Security string `json:"security"` TLSSettings *TLSConfig `json:"tlsSettings"` TCPSettings *TCPConfig `json:"tcpSettings"` KCPSettings *KCPConfig `json:"kcpSettings"` WSSettings *WebSocketConfig `json:"wsSettings"` HTTPSettings *HTTPConfig `json:"httpSettings"` DSSettings *DomainSocketConfig `json:"dsSettings"` QUICSettings *QUICConfig `json:"quicSettings"` GunSettings *GunConfig `json:"gunSettings"` GRPCSettings *GunConfig `json:"grpcSettings"` SocketSettings *SocketConfig `json:"sockopt"` }
func (*StreamConfig) Build ¶
func (c *StreamConfig) Build() (*internet.StreamConfig, error)
Build implements Buildable.
type SystemPolicy ¶
type SystemPolicy struct { StatsInboundUplink bool `json:"statsInboundUplink"` StatsInboundDownlink bool `json:"statsInboundDownlink"` StatsOutboundUplink bool `json:"statsOutboundUplink"` StatsOutboundDownlink bool `json:"statsOutboundDownlink"` }
func (*SystemPolicy) Build ¶
func (p *SystemPolicy) Build() (*policy.SystemPolicy, error)
type TCPConfig ¶
type TCPConfig struct { HeaderConfig json.RawMessage `json:"header"` AcceptProxyProtocol bool `json:"acceptProxyProtocol"` }
type TLSCertConfig ¶
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 ¶
func (c *TLSCertConfig) Build() (*tls.Certificate, error)
Build implements Buildable.
type TLSConfig ¶
type TLSConfig struct { Insecure bool `json:"allowInsecure"` Certs []*TLSCertConfig `json:"certificates"` ServerName string `json:"serverName"` ALPN *cfgcommon.StringList `json:"alpn"` EnableSessionResumption bool `json:"enableSessionResumption"` DisableSystemRoot bool `json:"disableSystemRoot"` PinnedPeerCertificateChainSha256 *[]string `json:"pinnedPeerCertificateChainSha256"` VerifyClientCertificate bool `json:"verifyClientCertificate"` }
type TransportConfig ¶
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"` GunConfig *GunConfig `json:"gunSettings"` GRPCConfig *GunConfig `json:"grpcSettings"` }
type TransportProtocol ¶
type TransportProtocol string
func (TransportProtocol) Build ¶
func (p TransportProtocol) Build() (string, error)
Build implements Buildable.
type TrojanClientConfig ¶
type TrojanClientConfig struct {
Servers []*TrojanServerTarget `json:"servers"`
}
TrojanClientConfig is configuration of trojan servers
type TrojanInboundFallback ¶
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 ¶
type TrojanServerConfig struct { Clients []*TrojanUserConfig `json:"clients"` Fallback json.RawMessage `json:"fallback"` Fallbacks []*TrojanInboundFallback `json:"fallbacks"` }
TrojanServerConfig is Inbound configuration
type TrojanServerTarget ¶
type TrojanServerTarget struct { Address *cfgcommon.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 ¶
type TrojanUserConfig struct { Password string `json:"password"` Level byte `json:"level"` Email string `json:"email"` }
TrojanUserConfig is user configuration
type UTPAuthenticator ¶
type UTPAuthenticator struct{}
type VMessAccount ¶
type VMessAccount struct { ID string `json:"id"` Security string `json:"security"` Experiments string `json:"experiments"` }
func (*VMessAccount) Build ¶
func (a *VMessAccount) Build() *vmess.Account
Build implements Buildable
type VMessDefaultConfig ¶
type VMessDefaultConfig struct {
Level byte `json:"level"`
}
func (*VMessDefaultConfig) Build ¶
func (c *VMessDefaultConfig) Build() *inbound.DefaultConfig
Build implements Buildable
type VMessDetourConfig ¶
type VMessDetourConfig struct {
ToTag string `json:"to"`
}
func (*VMessDetourConfig) Build ¶
func (c *VMessDetourConfig) Build() *inbound.DetourConfig
Build implements Buildable
type VMessInboundConfig ¶
type VMessInboundConfig struct { Users []json.RawMessage `json:"clients"` Features *FeaturesConfig `json:"features"` Defaults *VMessDefaultConfig `json:"default"` DetourConfig *VMessDetourConfig `json:"detour"` SecureOnly bool `json:"disableInsecureEncryption"` }
type VMessOutboundConfig ¶
type VMessOutboundConfig struct { Address *cfgcommon.Address `json:"address"` Port uint16 `json:"port"` Users []json.RawMessage `json:"users"` }
type WebSocketConfig ¶
type WebSocketConfig struct { Path string `json:"path"` Headers map[string]string `json:"headers"` AcceptProxyProtocol bool `json:"acceptProxyProtocol"` MaxEarlyData int32 `json:"maxEarlyData"` UseBrowserForwarding bool `json:"useBrowserForwarding"` EarlyDataHeaderName string `json:"earlyDataHeaderName"` }
type WechatVideoAuthenticator ¶
type WechatVideoAuthenticator struct{}
type WireguardAuthenticator ¶
type WireguardAuthenticator struct{}
Source Files ¶
- api.go
- blackhole.go
- browser_forwarder.go
- buildable.go
- conf.go
- dns.go
- dns_proxy.go
- dokodemo.go
- errors.generated.go
- fakedns.go
- freedom.go
- gun.go
- http.go
- init.go
- lint.go
- loader.go
- log.go
- loopback.go
- observatory.go
- policy.go
- reverse.go
- router.go
- router_strategy.go
- services.go
- shadowsocks.go
- socks.go
- transport.go
- transport_authenticators.go
- transport_internet.go
- trojan.go
- v2ray.go
- vmess.go