Documentation
¶
Index ¶
- func CoreHTTPRequest(inst *core.Instance, timeout time.Duration, method, dest string) (int, []byte, error)
- func CoreHTTPRequestCustom(inst *core.Instance, timeout time.Duration, req *http.Request) (int, []byte, error)
- func MeasureDelay(inst *core.Instance, timeout time.Duration, showBody bool, dest string, ...) (int64, int, []byte, error)
- type Examiner
- type GeneralConfig
- type Protocol
- type Result
- type Service
- type ServiceOption
- type Shadowsocks
- func (s *Shadowsocks) BuildInboundDetourConfig() (*conf.InboundDetourConfig, error)
- func (s *Shadowsocks) BuildOutboundDetourConfig(allowInsecure bool) (*conf.OutboundDetourConfig, error)
- func (s *Shadowsocks) ConvertToGeneralConfig() GeneralConfig
- func (s *Shadowsocks) DetailsStr() string
- func (s *Shadowsocks) Parse(configLink string) error
- type Socks
- func (s *Socks) BuildInboundDetourConfig() (*conf.InboundDetourConfig, error)
- func (s *Socks) BuildOutboundDetourConfig(allowInsecure bool) (*conf.OutboundDetourConfig, error)
- func (s *Socks) ConvertToGeneralConfig() GeneralConfig
- func (s *Socks) DetailsStr() string
- func (s *Socks) Parse(configLink string) error
- type Subscription
- type Trojan
- func (v *Trojan) BuildInboundDetourConfig() (*conf.InboundDetourConfig, error)
- func (t *Trojan) BuildOutboundDetourConfig(allowInsecure bool) (*conf.OutboundDetourConfig, error)
- func (t *Trojan) ConvertToGeneralConfig() GeneralConfig
- func (t *Trojan) DetailsStr() string
- func (t *Trojan) Parse(configLink string) error
- type Vless
- func (v *Vless) BuildInboundDetourConfig() (*conf.InboundDetourConfig, error)
- func (v *Vless) BuildOutboundDetourConfig(allowInsecure bool) (*conf.OutboundDetourConfig, error)
- func (v *Vless) ConvertToGeneralConfig() GeneralConfig
- func (v *Vless) DetailsStr() string
- func (v *Vless) Parse(configLink string) error
- type Vmess
- func (v *Vmess) BuildInboundDetourConfig() (*conf.InboundDetourConfig, error)
- func (v *Vmess) BuildOutboundDetourConfig(allowInsecure bool) (*conf.OutboundDetourConfig, error)
- func (v *Vmess) ConvertToGeneralConfig() GeneralConfig
- func (v *Vmess) DetailsStr() string
- func (v *Vmess) Parse(configLink string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CoreHTTPRequest ¶
func CoreHTTPRequestCustom ¶
Types ¶
type Examiner ¶
type GeneralConfig ¶
type Protocol ¶
type Protocol interface { Parse(configLink string) error BuildOutboundDetourConfig(allowInsecure bool) (*conf.OutboundDetourConfig, error) BuildInboundDetourConfig() (*conf.InboundDetourConfig, error) DetailsStr() string ConvertToGeneralConfig() GeneralConfig }
func ParseXrayConfig ¶
type Result ¶
type Result struct { ConfigLink string `csv:"link"` // vmess://... vless//..., etc Protocol Protocol `csv:"-"` Status string `csv:"status"` // passed, semi-passed, failed TLS string `csv:"tls"` // none, tls, reality RealIPAddr string `csv:"ip"` // Real ip address (req to cloudflare.com/cdn-cgi/trace) Delay int64 `csv:"delay"` // millisecond DownloadSpeed float32 `csv:"download"` // mbps UploadSpeed float32 `csv:"upload"` // mbps IpAddrLoc string `csv:"location"` // IP address location IpAddrCity string `csv:"location"` // IP address location }
type Service ¶
type Service struct { Inbound Protocol // Log Verbose bool LogType applog.LogType LogLevel commlog.Severity AllowInsecure bool }
func NewXrayService ¶
func NewXrayService(verbose bool, allowInsecure bool, opts ...ServiceOption) *Service
type ServiceOption ¶
type ServiceOption = func(c *Service)
func WithCustomLogLevel ¶
func WithCustomLogLevel(logType applog.LogType, LogLevel commlog.Severity) ServiceOption
func WithInbound ¶
func WithInbound(inbound Protocol) ServiceOption
type Shadowsocks ¶
type Shadowsocks struct { Address string Port string Encryption string Password string Remark string OrigLink string // Original link }
func (*Shadowsocks) BuildInboundDetourConfig ¶
func (s *Shadowsocks) BuildInboundDetourConfig() (*conf.InboundDetourConfig, error)
func (*Shadowsocks) BuildOutboundDetourConfig ¶
func (s *Shadowsocks) BuildOutboundDetourConfig(allowInsecure bool) (*conf.OutboundDetourConfig, error)
func (*Shadowsocks) ConvertToGeneralConfig ¶
func (s *Shadowsocks) ConvertToGeneralConfig() GeneralConfig
func (*Shadowsocks) DetailsStr ¶
func (s *Shadowsocks) DetailsStr() string
func (*Shadowsocks) Parse ¶
func (s *Shadowsocks) Parse(configLink string) error
type Socks ¶
type Socks struct { Remark string Address string // HOST:PORT Port string Username string // Username Password string // Password OrigLink string // Original link }
func (*Socks) BuildInboundDetourConfig ¶
func (s *Socks) BuildInboundDetourConfig() (*conf.InboundDetourConfig, error)
func (*Socks) BuildOutboundDetourConfig ¶
func (s *Socks) BuildOutboundDetourConfig(allowInsecure bool) (*conf.OutboundDetourConfig, error)
func (*Socks) ConvertToGeneralConfig ¶
func (s *Socks) ConvertToGeneralConfig() GeneralConfig
func (*Socks) DetailsStr ¶
type Subscription ¶
type Subscription struct { Remark string Url string UserAgent string Method string ConfigLinks []string }
TODO: Make a database to store subscriptions
func (*Subscription) FetchAll ¶
func (s *Subscription) FetchAll() ([]string, error)
func (*Subscription) RemoveDuplicate ¶
func (s *Subscription) RemoveDuplicate(verbose bool)
type Trojan ¶
type Trojan struct { LinkVersion string `json:"-"` Password string // Password Address string `json:"add"` // HOST:PORT Flow string `json:"flow"` Security string `json:"security"` // tls HeaderType string `json:"headerType"` // TCP HTTP Obfuscation Host string `json:"host"` // HTTP, WS Path string `json:"path"` Port string `json:"port"` SNI string `json:"sni"` // Server name indication ALPN string `json:"alpn"` // Application-Layer Protocol Negotiation TlsFingerprint string `json:"fp"` // TLS fingerprint AllowInsecure string `json:"allowInsecure"` // Insecure TLS Type string `json:"type"` // Network Remark string // Config's name ServiceName string `json:"serviceName"` // GRPC Mode string `json:"mode"` // GRPC OrigLink string `json:"-"` // Original link }
func (*Trojan) BuildInboundDetourConfig ¶
func (v *Trojan) BuildInboundDetourConfig() (*conf.InboundDetourConfig, error)
func (*Trojan) BuildOutboundDetourConfig ¶
func (t *Trojan) BuildOutboundDetourConfig(allowInsecure bool) (*conf.OutboundDetourConfig, error)
func (*Trojan) ConvertToGeneralConfig ¶
func (t *Trojan) ConvertToGeneralConfig() GeneralConfig
func (*Trojan) DetailsStr ¶
type Vless ¶
type Vless struct { LinkVersion string `json:"-"` ID string `json:"id"` // UUID Address string `json:"add"` // HOST:PORT Encryption string `json:"encryption"` Flow string `json:"flow"` Security string `json:"security"` // reality or tls PublicKey string `json:"pbk"` ShortIds string `json:"sid"` // Mandatory, the shortId list available to the client, which can be used to distinguish different clients SpiderX string `json:"spx"` // Reality path HeaderType string `json:"headerType"` // TCP HTTP Obfuscation Host string `json:"host"` // HTTP, WS Path string `json:"path"` Port string `json:"port"` SNI string `json:"sni"` // Server name indication ALPN string `json:"alpn"` // Application-Layer Protocol Negotiation TlsFingerprint string `json:"fp"` // TLS fingerprint Type string `json:"type"` // Network Remark string `json:"ps"` // Config's name ServiceName string `json:"serviceName"` // GRPC Mode string `json:"mode"` // GRPC OrigLink string `json:"-"` // Original link }
func (*Vless) BuildInboundDetourConfig ¶
func (v *Vless) BuildInboundDetourConfig() (*conf.InboundDetourConfig, error)
func (*Vless) BuildOutboundDetourConfig ¶
func (v *Vless) BuildOutboundDetourConfig(allowInsecure bool) (*conf.OutboundDetourConfig, error)
func (*Vless) ConvertToGeneralConfig ¶
func (v *Vless) ConvertToGeneralConfig() GeneralConfig
func (*Vless) DetailsStr ¶
type Vmess ¶
type Vmess struct { Version interface{} `json:"v"` Address string `json:"add"` Aid interface{} `json:"aid"` // AlterID Port interface{} `json:"port"` Security string `json:"scy"` Host string `json:"host"` ID string `json:"id"` Network string `json:"net"` Path string `json:"path"` Remark string `json:"ps"` // Config's name TLS string `json:"tls"` AllowInsecure interface{} `json:"allowinsecure"` SNI string `json:"sni"` // Server name indication ALPN string `json:"alpn"` // Application-Layer Protocol Negotiation TlsFingerprint string `json:"fp"` // TLS fingerprint Type string `json:"type"` // Used for HTTP Obfuscation OrigLink string `json:"-"` // Original link }
func (*Vmess) BuildInboundDetourConfig ¶
func (v *Vmess) BuildInboundDetourConfig() (*conf.InboundDetourConfig, error)
func (*Vmess) BuildOutboundDetourConfig ¶
func (v *Vmess) BuildOutboundDetourConfig(allowInsecure bool) (*conf.OutboundDetourConfig, error)
func (*Vmess) ConvertToGeneralConfig ¶
func (v *Vmess) ConvertToGeneralConfig() GeneralConfig
func (*Vmess) DetailsStr ¶
Click to show internal directories.
Click to hide internal directories.