proxy

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorNotSSRLink             = errors.New("not a correct ssr link")
	ErrorPasswordParseFail      = errors.New("password parse failed")
	ErrorPathNotComplete        = errors.New("path not complete")
	ErrorMissingQuery           = errors.New("link missing query")
	ErrorProtocolParamParseFail = errors.New("protocol param parse failed")
	ErrorObfsParamParseFail     = errors.New("obfs param parse failed")
)
View Source
var (
	ErrorNotVmessLink          = errors.New("not a correct vmess link")
	ErrorVmessPayloadParseFail = errors.New("vmess link payload parse failed")
)
View Source
var (
	ErrorNotSSLink = errors.New("not a correct ss link")
)

Functions

func GrepSSLinkFromString

func GrepSSLinkFromString(text string) []string

func GrepSSRLinkFromString

func GrepSSRLinkFromString(text string) []string

func GrepVmessLinkFromString

func GrepVmessLinkFromString(text string) []string

Types

type Base

type Base struct {
	Name   string `yaml:"name" json:"name"`
	Server string `yaml:"server" json:"server"`
	Port   int    `yaml:"port" json:"port"`
	Type   string `yaml:"type" json:"type"`
	UDP    bool   `yaml:"udp,omitempty" json:"udp,omitempty"`
}

type HTTPOptions

type HTTPOptions struct {
	Method  string              `yaml:"method,omitempty" json:"method,omitempty"`
	Path    []string            `yaml:"path,omitempty" json:"path,omitempty"`
	Headers map[string][]string `yaml:"headers,omitempty" json:"headers,omitempty"`
}

type Proxy

type Proxy interface {
	String() string
	ToClash() string
	ToSurge() string
	Identifier() string
	SetName(name string)
}

func Deduplication

func Deduplication(src []Proxy) []Proxy

type Shadowsocks

type Shadowsocks struct {
	Base
	Password   string                 `yaml:"password" json:"password"`
	Cipher     string                 `yaml:"cipher" json:"cipher"`
	Plugin     string                 `yaml:"plugin,omitempty" json:"plugin,omitempty"`
	PluginOpts map[string]interface{} `yaml:"plugin-opts,omitempty" json:"plugin-opts,omitempty"`
}
func ParseSSLink(link string) (*Shadowsocks, error)

func (Shadowsocks) Identifier

func (ss Shadowsocks) Identifier() string

func (*Shadowsocks) SetName

func (ss *Shadowsocks) SetName(name string)

func (Shadowsocks) String

func (ss Shadowsocks) String() string

func (Shadowsocks) ToClash

func (ss Shadowsocks) ToClash() string

func (Shadowsocks) ToSurge

func (ss Shadowsocks) ToSurge() string

type ShadowsocksR

type ShadowsocksR struct {
	Base
	Password      string `yaml:"password" json:"password"`
	Cipher        string `yaml:"cipher" json:"cipher"`
	Protocol      string `yaml:"protocol" json:"protocol"`
	ProtocolParam string `yaml:"protocol-param,omitempty" json:"protocol_param,omitempty"`
	Obfs          string `yaml:"obfs" json:"obfs"`
	ObfsParam     string `yaml:"obfs-param,omitempty" json:"obfs_param,omitempty"`
	Group         string `yaml:"group,omitempty" json:"group,omitempty"`
}
func ParseSSRLink(link string) (*ShadowsocksR, error)

func (ShadowsocksR) Identifier

func (ssr ShadowsocksR) Identifier() string

func (*ShadowsocksR) SetName

func (ssr *ShadowsocksR) SetName(name string)

func (ShadowsocksR) String

func (ssr ShadowsocksR) String() string

func (ShadowsocksR) ToClash

func (ssr ShadowsocksR) ToClash() string

func (ShadowsocksR) ToSurge

func (ssr ShadowsocksR) ToSurge() string

type Vmess

type Vmess struct {
	Base
	UUID           string            `yaml:"uuid" json:"uuid"`
	AlterID        int               `yaml:"alterId" json:"alterId"`
	Cipher         string            `yaml:"cipher" json:"cipher"`
	TLS            bool              `yaml:"tls,omitempty" json:"tls,omitempty"`
	Network        string            `yaml:"network,omitempty" json:"network,omitempty"`
	HTTPOpts       HTTPOptions       `yaml:"http-opts,omitempty" json:"http-opts,omitempty"`
	WSPath         string            `yaml:"ws-path,omitempty" json:"ws-path,omitempty"`
	WSHeaders      map[string]string `yaml:"ws-headers,omitempty" json:"ws-headers,omitempty"`
	SkipCertVerify bool              `yaml:"skip-cert-verify,omitempty" json:"skip-cert-verify,omitempty"`
	ServerName     string            `yaml:"servername,omitempty" json:"servername,omitempty"`
}
func ParseVmessLink(link string) (*Vmess, error)

func (Vmess) Identifier

func (v Vmess) Identifier() string

func (*Vmess) SetName

func (v *Vmess) SetName(name string)

func (Vmess) String

func (v Vmess) String() string

func (Vmess) ToClash

func (v Vmess) ToClash() string

func (Vmess) ToSurge

func (v Vmess) ToSurge() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL