Documentation ¶
Index ¶
- Constants
- func DefaultLogConfig() *log.Config
- func ParseIP(s string) (*router.CIDR, error)
- func ParseRule(msg json.RawMessage) (*router.RoutingRule, error)
- type Address
- type ApiConfig
- type BlackholeConfig
- type Buildable
- type Config
- type ConfigCreator
- type ConfigCreatorCache
- type DTLSAuthenticator
- type DnsConfig
- type DokodemoConfig
- type DomainSocketConfig
- type FeaturesConfig
- type FreedomConfig
- type HTTPAuthenticator
- type HTTPAuthenticatorRequest
- type HTTPAuthenticatorResponse
- type HTTPConfig
- type HttpAccount
- type HttpResponse
- type HttpServerConfig
- type InboundConnectionConfig
- type InboundDetourAllocationConfig
- type InboundDetourConfig
- type JSONConfigLoader
- type KCPConfig
- type LogConfig
- type MTProtoAccount
- type MTProtoClientConfig
- type MTProtoServerConfig
- type MuxConfig
- type Network
- type NetworkList
- type NoOpAuthenticator
- type NoOpConnectionAuthenticator
- type NoneResponse
- type OutboundConnectionConfig
- type OutboundDetourConfig
- type Policy
- type PolicyConfig
- type PortRange
- type ProxyConfig
- type RouterConfig
- type RouterRule
- type RouterRulesConfig
- type SRTPAuthenticator
- type ShadowsocksClientConfig
- type ShadowsocksServerConfig
- type ShadowsocksServerTarget
- type SniffingConfig
- type SocksAccount
- type SocksClientConfig
- type SocksRemoteConfig
- type SocksServerConfig
- type StatsConfig
- type StreamConfig
- type StringList
- type SystemPolicy
- type TCPConfig
- type TLSCertConfig
- type TLSConfig
- type TransportConfig
- type TransportProtocol
- type UTPAuthenticator
- type User
- type VMessAccount
- type VMessDefaultConfig
- type VMessDetourConfig
- type VMessInboundConfig
- type VMessOutboundConfig
- type VMessOutboundTarget
- type WebSocketConfig
- type WechatVideoAuthenticator
Constants ¶
View Source
const ( AuthMethodNoAuth = "noauth" AuthMethodUserPass = "password" )
Variables ¶
This section is empty.
Functions ¶
func DefaultLogConfig ¶
func ParseRule ¶
func ParseRule(msg json.RawMessage) (*router.RoutingRule, error)
Types ¶
type Address ¶
func (*Address) Build ¶
func (v *Address) Build() *v2net.IPOrDomain
func (*Address) UnmarshalJSON ¶
type BlackholeConfig ¶
type BlackholeConfig struct {
Response json.RawMessage `json:"response"`
}
func (*BlackholeConfig) Build ¶
func (v *BlackholeConfig) Build() (*serial.TypedMessage, error)
type Buildable ¶
type Buildable interface {
Build() (*serial.TypedMessage, error)
}
type Config ¶
type Config struct { Port uint16 `json:"port"` // Port of this Point server. LogConfig *LogConfig `json:"log"` RouterConfig *RouterConfig `json:"routing"` DNSConfig *DnsConfig `json:"dns"` InboundConfig *InboundConnectionConfig `json:"inbound"` OutboundConfig *OutboundConnectionConfig `json:"outbound"` InboundDetours []InboundDetourConfig `json:"inboundDetour"` OutboundDetours []OutboundDetourConfig `json:"outboundDetour"` Transport *TransportConfig `json:"transport"` Policy *PolicyConfig `json:"policy"` Api *ApiConfig `json:"api"` Stats *StatsConfig `json:"stats"` }
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 DTLSAuthenticator ¶
type DTLSAuthenticator struct{}
func (DTLSAuthenticator) Build ¶
func (DTLSAuthenticator) Build() (*serial.TypedMessage, error)
type DnsConfig ¶
type DnsConfig struct { Servers []*Address `json:"servers"` Hosts map[string]*Address `json:"hosts"` ClientIP *Address `json:"clientIp"` }
DnsConfig is a JSON serializable object for dns.Config.
type DokodemoConfig ¶
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 ¶
func (v *DokodemoConfig) Build() (*serial.TypedMessage, error)
type DomainSocketConfig ¶
func (*DomainSocketConfig) Build ¶
func (c *DomainSocketConfig) Build() (*serial.TypedMessage, error)
type FeaturesConfig ¶
type FeaturesConfig struct {
Detour *VMessDetourConfig `json:"detour"`
}
type FreedomConfig ¶
type FreedomConfig struct { DomainStrategy string `json:"domainStrategy"` Timeout *uint32 `json:"timeout"` Redirect string `json:"redirect"` UserLevel uint32 `json:"userLevel"` }
func (*FreedomConfig) Build ¶
func (c *FreedomConfig) Build() (*serial.TypedMessage, error)
Build implements Buildable
type HTTPAuthenticator ¶
type HTTPAuthenticator struct { Request HTTPAuthenticatorRequest `json:"request"` Response HTTPAuthenticatorResponse `json:"response"` }
func (*HTTPAuthenticator) Build ¶
func (v *HTTPAuthenticator) Build() (*serial.TypedMessage, error)
type HTTPAuthenticatorRequest ¶
type HTTPAuthenticatorRequest struct { Version string `json:"version"` Method string `json:"method"` Path StringList `json:"path"` Headers map[string]*StringList `json:"headers"` }
func (*HTTPAuthenticatorRequest) Build ¶
func (v *HTTPAuthenticatorRequest) Build() (*http.RequestConfig, error)
type HTTPAuthenticatorResponse ¶
type HTTPAuthenticatorResponse struct { Version string `json:"version"` Status string `json:"status"` Reason string `json:"reason"` Headers map[string]*StringList `json:"headers"` }
func (*HTTPAuthenticatorResponse) Build ¶
func (v *HTTPAuthenticatorResponse) Build() (*http.ResponseConfig, error)
type HTTPConfig ¶
type HTTPConfig struct { Host *StringList `json:"host"` Path string `json:"path"` }
func (*HTTPConfig) Build ¶
func (c *HTTPConfig) Build() (*serial.TypedMessage, error)
type HttpAccount ¶
type HttpResponse ¶
type HttpResponse struct{}
func (*HttpResponse) Build ¶
func (*HttpResponse) Build() (*serial.TypedMessage, error)
type HttpServerConfig ¶
type HttpServerConfig struct { Timeout uint32 `json:"timeout"` Accounts []*HttpAccount `json:"accounts"` Transparent bool `json:"allowTransparent"` UserLevel uint32 `json:"userLevel"` }
func (*HttpServerConfig) Build ¶
func (c *HttpServerConfig) Build() (*serial.TypedMessage, error)
type InboundConnectionConfig ¶
type InboundConnectionConfig struct { Port *PortRange `json:"port"` Listen *Address `json:"listen"` Protocol string `json:"protocol"` StreamSetting *StreamConfig `json:"streamSettings"` Settings json.RawMessage `json:"settings"` Tag string `json:"tag"` DomainOverride *StringList `json:"domainOverride"` Sniffing *SniffingConfig `json:"sniffing"` }
func (*InboundConnectionConfig) Build ¶
func (c *InboundConnectionConfig) Build() (*core.InboundHandlerConfig, error)
Build implements Buildable.
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 *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 ¶
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"` }
type LogConfig ¶
type MTProtoAccount ¶
type MTProtoAccount struct {
Secret string `json:"secret"`
}
type MTProtoClientConfig ¶
type MTProtoClientConfig struct { }
func (*MTProtoClientConfig) Build ¶
func (c *MTProtoClientConfig) Build() (*serial.TypedMessage, error)
type MTProtoServerConfig ¶
type MTProtoServerConfig struct {
Users []json.RawMessage `json:"users"`
}
func (*MTProtoServerConfig) Build ¶
func (c *MTProtoServerConfig) Build() (*serial.TypedMessage, error)
type MuxConfig ¶
func (*MuxConfig) GetConcurrency ¶
type NetworkList ¶
type NetworkList []Network
func (*NetworkList) Build ¶
func (v *NetworkList) Build() *v2net.NetworkList
func (*NetworkList) UnmarshalJSON ¶
func (v *NetworkList) UnmarshalJSON(data []byte) error
type NoOpAuthenticator ¶
type NoOpAuthenticator struct{}
func (NoOpAuthenticator) Build ¶
func (NoOpAuthenticator) Build() (*serial.TypedMessage, error)
type NoOpConnectionAuthenticator ¶
type NoOpConnectionAuthenticator struct{}
func (NoOpConnectionAuthenticator) Build ¶
func (NoOpConnectionAuthenticator) Build() (*serial.TypedMessage, error)
type NoneResponse ¶
type NoneResponse struct{}
func (*NoneResponse) Build ¶
func (*NoneResponse) Build() (*serial.TypedMessage, error)
type OutboundConnectionConfig ¶
type OutboundConnectionConfig struct { Protocol string `json:"protocol"` SendThrough *Address `json:"sendThrough"` StreamSetting *StreamConfig `json:"streamSettings"` ProxySettings *ProxyConfig `json:"proxySettings"` Settings json.RawMessage `json:"settings"` Tag string `json:"tag"` MuxSettings *MuxConfig `json:"mux"` }
func (*OutboundConnectionConfig) Build ¶
func (c *OutboundConnectionConfig) Build() (*core.OutboundHandlerConfig, error)
Build implements Buildable.
type OutboundDetourConfig ¶
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 ¶
func (c *OutboundDetourConfig) Build() (*core.OutboundHandlerConfig, error)
Build implements Buildable.
type Policy ¶
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"` }
type PolicyConfig ¶
type PolicyConfig struct { Levels map[uint32]*Policy `json:"levels"` System *SystemPolicy `json:"system"` }
type PortRange ¶
func (*PortRange) UnmarshalJSON ¶
UnmarshalJSON implements encoding/json.Unmarshaler.UnmarshalJSON
type ProxyConfig ¶
type ProxyConfig struct {
Tag string `json:"tag"`
}
func (*ProxyConfig) Build ¶
func (v *ProxyConfig) Build() (*internet.ProxyConfig, error)
Build implements Buildable.
type RouterConfig ¶
type RouterConfig struct {
Settings *RouterRulesConfig `json:"settings"`
}
type RouterRule ¶
type RouterRulesConfig ¶
type RouterRulesConfig struct { RuleList []json.RawMessage `json:"rules"` DomainStrategy string `json:"domainStrategy"` }
type SRTPAuthenticator ¶
type SRTPAuthenticator struct{}
func (SRTPAuthenticator) Build ¶
func (SRTPAuthenticator) Build() (*serial.TypedMessage, error)
type ShadowsocksClientConfig ¶
type ShadowsocksClientConfig struct {
Servers []*ShadowsocksServerTarget `json:"servers"`
}
func (*ShadowsocksClientConfig) Build ¶
func (v *ShadowsocksClientConfig) Build() (*serial.TypedMessage, error)
type ShadowsocksServerConfig ¶
type ShadowsocksServerConfig struct { Cipher string `json:"method"` Password string `json:"password"` UDP bool `json:"udp"` Level byte `json:"level"` Email string `json:"email"` OTA *bool `json:"ota"` NetworkList *NetworkList `json:"network"` }
func (*ShadowsocksServerConfig) Build ¶
func (v *ShadowsocksServerConfig) Build() (*serial.TypedMessage, error)
type ShadowsocksServerTarget ¶
type SniffingConfig ¶
type SniffingConfig struct { Enabled bool `json:"enabled"` DestOverride *StringList `json:"destOverride"` }
func (*SniffingConfig) Build ¶
func (c *SniffingConfig) Build() (*proxyman.SniffingConfig, error)
type SocksAccount ¶
func (*SocksAccount) Build ¶
func (v *SocksAccount) Build() *socks.Account
type SocksClientConfig ¶
type SocksClientConfig struct {
Servers []*SocksRemoteConfig `json:"servers"`
}
func (*SocksClientConfig) Build ¶
func (v *SocksClientConfig) Build() (*serial.TypedMessage, error)
type SocksRemoteConfig ¶
type SocksRemoteConfig struct { Address *Address `json:"address"` Port uint16 `json:"port"` Users []json.RawMessage `json:"users"` }
type SocksServerConfig ¶
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 ¶
func (v *SocksServerConfig) Build() (*serial.TypedMessage, error)
type StatsConfig ¶
type StatsConfig struct{}
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"` }
func (*StreamConfig) Build ¶
func (c *StreamConfig) Build() (*internet.StreamConfig, error)
Build implements Buildable.
type StringList ¶
type StringList []string
func NewStringList ¶
func NewStringList(raw []string) *StringList
func (StringList) Len ¶
func (v StringList) Len() int
func (*StringList) UnmarshalJSON ¶
func (v *StringList) UnmarshalJSON(data []byte) error
type SystemPolicy ¶
type SystemPolicy struct { StatsInboundUplink bool `json:"statsInboundUplink"` StatsInboundDownlink bool `json:"statsInboundDownlink"` }
func (*SystemPolicy) Build ¶
func (p *SystemPolicy) Build() (*policy.SystemPolicy, error)
type TCPConfig ¶
type TCPConfig struct {
HeaderConfig json.RawMessage `json:"header"`
}
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)
type TLSConfig ¶
type TLSConfig struct { Insecure bool `json:"allowInsecure"` InsecureCiphers bool `json:"allowInsecureCiphers"` Certs []*TLSCertConfig `json:"certificates"` ServerName string `json:"serverName"` ALPN *StringList `json:"alpn"` }
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"` }
type TransportProtocol ¶
type TransportProtocol string
func (TransportProtocol) Build ¶
func (p TransportProtocol) Build() (internet.TransportProtocol, error)
Build implements Buildable.
type UTPAuthenticator ¶
type UTPAuthenticator struct{}
func (UTPAuthenticator) Build ¶
func (UTPAuthenticator) Build() (*serial.TypedMessage, error)
type VMessAccount ¶
type VMessAccount struct { ID string `json:"id"` AlterIds uint16 `json:"alterId"` Security string `json:"security"` }
func (*VMessAccount) Build ¶
func (a *VMessAccount) Build() *vmess.Account
Build implements Buildable
type VMessDefaultConfig ¶
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"` }
func (*VMessInboundConfig) Build ¶
func (c *VMessInboundConfig) Build() (*serial.TypedMessage, error)
Build implements Buildable
type VMessOutboundConfig ¶
type VMessOutboundConfig struct {
Receivers []*VMessOutboundTarget `json:"vnext"`
}
func (*VMessOutboundConfig) Build ¶
func (c *VMessOutboundConfig) Build() (*serial.TypedMessage, error)
Build implements Buildable
type VMessOutboundTarget ¶
type VMessOutboundTarget struct { Address *Address `json:"address"` Port uint16 `json:"port"` Users []json.RawMessage `json:"users"` }
type WebSocketConfig ¶
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"` }
func (*WebSocketConfig) Build ¶
func (c *WebSocketConfig) Build() (*serial.TypedMessage, error)
Build implements Buildable.
type WechatVideoAuthenticator ¶
type WechatVideoAuthenticator struct{}
func (WechatVideoAuthenticator) Build ¶
func (WechatVideoAuthenticator) Build() (*serial.TypedMessage, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.