Documentation ¶
Index ¶
- Constants
- Variables
- func ParseRule(msg json.RawMessage) *router.RoutingRule
- type Address
- type BlackholeConfig
- type Buildable
- type Config
- type ConfigCreator
- type ConfigCreatorCache
- type DnsConfig
- type DokodemoConfig
- type FeaturesConfig
- type FreedomConfig
- type HTTPAuthenticator
- type HTTPAuthenticatorRequest
- type HTTPAuthenticatorResponse
- type HttpResponse
- type HttpServerConfig
- type InboundConnectionConfig
- type InboundDetourAllocationConfig
- type InboundDetourConfig
- type JSONConfigLoader
- type KCPConfig
- type LogConfig
- type Network
- type NetworkList
- type NoOpAuthenticator
- type NoOpConnectionAuthenticator
- type NoneResponse
- type OutboundConnectionConfig
- type OutboundDetourConfig
- type PortRange
- type ProxyConfig
- type RouterConfig
- type RouterRule
- type RouterRulesConfig
- type SRTPAuthenticator
- type ShadowsocksClientConfig
- type ShadowsocksServerConfig
- type ShadowsocksServerTarget
- type SocksAccount
- type SocksClientConfig
- type SocksRemoteConfig
- type SocksServerConfig
- type StreamConfig
- type StringList
- type TCPConfig
- type TLSCertConfig
- type TLSConfig
- type TransportConfig
- type UTPAuthenticator
- type User
- type VMessAccount
- type VMessDefaultConfig
- type VMessDetourConfig
- type VMessInboundConfig
- type VMessOutboundConfig
- type VMessOutboundTarget
- type WebSocketConfig
Constants ¶
View Source
const ( AuthMethodNoAuth = "noauth" AuthMethodUserPass = "password" )
Variables ¶
Functions ¶
func ParseRule ¶
func ParseRule(msg json.RawMessage) *router.RoutingRule
Types ¶
type Address ¶
func (*Address) Build ¶
func (v *Address) Build() *v2net.IPOrDomain
type BlackholeConfig ¶
type BlackholeConfig struct {
Response json.RawMessage `json:"response"`
}
func (*BlackholeConfig) Build ¶
func (v *BlackholeConfig) Build() (*loader.TypedSettings, error)
type Buildable ¶
type Buildable interface {
Build() (*loader.TypedSettings, 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"` }
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 DokodemoConfig ¶
type DokodemoConfig struct { Host *Address `json:"address"` PortValue uint16 `json:"port"` NetworkList *NetworkList `json:"network"` TimeoutValue uint32 `json:"timeout"` Redirect bool `json:"followRedirect"` }
func (*DokodemoConfig) Build ¶
func (v *DokodemoConfig) Build() (*loader.TypedSettings, error)
type FeaturesConfig ¶
type FeaturesConfig struct {
Detour *VMessDetourConfig `json:"detour"`
}
type FreedomConfig ¶
type FreedomConfig struct { DomainStrategy string `json:"domainStrategy"` Timeout uint32 `json:"timeout"` }
func (*FreedomConfig) Build ¶
func (v *FreedomConfig) Build() (*loader.TypedSettings, error)
type HTTPAuthenticator ¶
type HTTPAuthenticator struct { Request HTTPAuthenticatorRequest `json:"request"` Response HTTPAuthenticatorResponse `json:"response"` }
func (*HTTPAuthenticator) Build ¶
func (v *HTTPAuthenticator) Build() (*loader.TypedSettings, 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 HttpResponse ¶
type HttpResponse struct{}
func (*HttpResponse) Build ¶
func (*HttpResponse) Build() (*loader.TypedSettings, error)
type HttpServerConfig ¶
type HttpServerConfig struct {
Timeout uint32 `json:"timeout"`
}
func (*HttpServerConfig) Build ¶
func (v *HttpServerConfig) Build() (*loader.TypedSettings, error)
type InboundConnectionConfig ¶
type InboundConnectionConfig struct { Port uint16 `json:"port"` Listen *Address `json:"listen"` Protocol string `json:"protocol"` StreamSetting *StreamConfig `json:"streamSettings"` Settings json.RawMessage `json:"settings"` AllowPassive bool `json:"allowPassive"` Tag string `json:"tag"` }
func (*InboundConnectionConfig) Build ¶
func (v *InboundConnectionConfig) Build() (*core.InboundConnectionConfig, error)
type InboundDetourAllocationConfig ¶
type InboundDetourAllocationConfig struct { Strategy string `json:"strategy"` Concurrency *uint32 `json:"concurrency"` RefreshMin *uint32 `json:"refresh"` }
func (*InboundDetourAllocationConfig) Build ¶
func (v *InboundDetourAllocationConfig) Build() (*core.AllocationStrategy, error)
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"` AllowPassive bool `json:"allowPassive"` }
func (*InboundDetourConfig) Build ¶
func (v *InboundDetourConfig) Build() (*core.InboundConnectionConfig, error)
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"` }
func (*KCPConfig) Build ¶
func (v *KCPConfig) Build() (*loader.TypedSettings, error)
type LogConfig ¶
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() (*loader.TypedSettings, error)
type NoOpConnectionAuthenticator ¶
type NoOpConnectionAuthenticator struct{}
func (NoOpConnectionAuthenticator) Build ¶
func (NoOpConnectionAuthenticator) Build() (*loader.TypedSettings, error)
type NoneResponse ¶
type NoneResponse struct{}
func (*NoneResponse) Build ¶
func (*NoneResponse) Build() (*loader.TypedSettings, 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"` }
func (*OutboundConnectionConfig) Build ¶
func (v *OutboundConnectionConfig) Build() (*core.OutboundConnectionConfig, error)
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"` }
func (*OutboundDetourConfig) Build ¶
func (v *OutboundDetourConfig) Build() (*core.OutboundConnectionConfig, error)
type PortRange ¶
type ProxyConfig ¶
type ProxyConfig struct {
Tag string `json:"tag"`
}
func (*ProxyConfig) Build ¶
func (v *ProxyConfig) Build() (*internet.ProxyConfig, error)
type RouterConfig ¶
type RouterConfig struct {
Settings *RouterRulesConfig `json:"settings"`
}
func (*RouterConfig) Build ¶
func (v *RouterConfig) Build() (*router.Config, error)
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() (*loader.TypedSettings, error)
type ShadowsocksClientConfig ¶
type ShadowsocksClientConfig struct {
Servers []*ShadowsocksServerTarget `json:"servers"`
}
func (*ShadowsocksClientConfig) Build ¶
func (v *ShadowsocksClientConfig) Build() (*loader.TypedSettings, 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"` }
func (*ShadowsocksServerConfig) Build ¶
func (v *ShadowsocksServerConfig) Build() (*loader.TypedSettings, error)
type ShadowsocksServerTarget ¶
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() (*loader.TypedSettings, 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"` }
func (*SocksServerConfig) Build ¶
func (v *SocksServerConfig) Build() (*loader.TypedSettings, error)
type StreamConfig ¶
type StreamConfig struct { Network *Network `json:"network"` Security string `json:"security"` TLSSettings *TLSConfig `json:"tlsSettings"` TCPSettings *TCPConfig `json:"tcpSettings"` KCPSettings *KCPConfig `json:"kcpSettings"` WSSettings *WebSocketConfig `json:"wsSettings"` }
func (*StreamConfig) Build ¶
func (v *StreamConfig) Build() (*internet.StreamConfig, error)
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 TCPConfig ¶
type TCPConfig struct { ConnectionReuse *bool `json:"connectionReuse"` HeaderConfig json.RawMessage `json:"header"` }
func (*TCPConfig) Build ¶
func (v *TCPConfig) Build() (*loader.TypedSettings, error)
type TLSCertConfig ¶
type TLSConfig ¶
type TLSConfig struct { Insecure bool `json:"allowInsecure"` Certs []*TLSCertConfig `json:"certificates"` ServerName string `json:"serverName"` }
func (*TLSConfig) Build ¶
func (v *TLSConfig) Build() (*loader.TypedSettings, error)
type TransportConfig ¶
type TransportConfig struct { TCPConfig *TCPConfig `json:"tcpSettings"` KCPConfig *KCPConfig `json:"kcpSettings"` WSConfig *WebSocketConfig `json:"wsSettings"` }
func (*TransportConfig) Build ¶
func (v *TransportConfig) Build() (*transport.Config, error)
type UTPAuthenticator ¶
type UTPAuthenticator struct{}
func (UTPAuthenticator) Build ¶
func (UTPAuthenticator) Build() (*loader.TypedSettings, error)
type User ¶
type VMessAccount ¶
type VMessAccount struct { ID string `json:"id"` AlterIds uint16 `json:"alterId"` Security string `json:"security"` }
func (*VMessAccount) Build ¶
func (v *VMessAccount) Build() *vmess.Account
type VMessDefaultConfig ¶
func (*VMessDefaultConfig) Build ¶
func (v *VMessDefaultConfig) Build() *inbound.DefaultConfig
type VMessDetourConfig ¶
type VMessDetourConfig struct {
ToTag string `json:"to"`
}
func (*VMessDetourConfig) Build ¶
func (v *VMessDetourConfig) Build() *inbound.DetourConfig
type VMessInboundConfig ¶
type VMessInboundConfig struct { Users []json.RawMessage `json:"clients"` Features *FeaturesConfig `json:"features"` Defaults *VMessDefaultConfig `json:"default"` DetourConfig *VMessDetourConfig `json:"detour"` }
func (*VMessInboundConfig) Build ¶
func (v *VMessInboundConfig) Build() (*loader.TypedSettings, error)
type VMessOutboundConfig ¶
type VMessOutboundConfig struct {
Receivers []*VMessOutboundTarget `json:"vnext"`
}
func (*VMessOutboundConfig) Build ¶
func (v *VMessOutboundConfig) Build() (*loader.TypedSettings, error)
type VMessOutboundTarget ¶
type VMessOutboundTarget struct { Address *Address `json:"address"` Port uint16 `json:"port"` Users []json.RawMessage `json:"users"` }
type WebSocketConfig ¶
type WebSocketConfig struct { ConnectionReuse *bool `json:"connectionReuse"` Path string `json:"Path"` }
func (*WebSocketConfig) Build ¶
func (v *WebSocketConfig) Build() (*loader.TypedSettings, error)
Click to show internal directories.
Click to hide internal directories.