parser

package
v0.0.0-...-3328d9f Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemeSS        string = "ss://"
	SchemeTrojan    string = "trojan://"
	SchemeVless     string = "vless://"
	SchemeVmess     string = "vmess://"
	SchemeSocks     string = "socks://"
	SchemeHttp      string = "http://"
	SchemeWireguard string = "wireguard://"
)

Variables

View Source
var SSMethod map[string]struct{} = map[string]struct{}{
	"2022-blake3-aes-128-gcm":       {},
	"2022-blake3-aes-256-gcm":       {},
	"2022-blake3-chacha20-poly1305": {},
	"none":                          {},
	"aes-128-gcm":                   {},
	"aes-192-gcm":                   {},
	"aes-256-gcm":                   {},
	"chacha20-ietf-poly1305":        {},
	"xchacha20-ietf-poly1305":       {},
	"aes-128-ctr":                   {},
	"aes-192-ctr":                   {},
	"aes-256-ctr":                   {},
	"aes-128-cfb":                   {},
	"aes-192-cfb":                   {},
	"aes-256-cfb":                   {},
	"rc4-md5":                       {},
	"chacha20-ietf":                 {},
	"xchacha20":                     {},
}

Functions

func GetVpnScheme

func GetVpnScheme(rawUri string) string

func HTTPTest

func HTTPTest()

func HandleQuery

func HandleQuery(rawUri string) (result string)

func ParseRawUri

func ParseRawUri(rawUri string) (result string)

func SocksTest

func SocksTest()

func TrojanTest

func TrojanTest()

func VlessTest

func VlessTest()

func VmessTest

func VmessTest()

Types

type ParserHTTP

type ParserHTTP struct {
	Address string
	Port    int
	User    string
	Pass    string
	*StreamField
}

func (*ParserHTTP) GetAddr

func (that *ParserHTTP) GetAddr() string

func (*ParserHTTP) GetPort

func (that *ParserHTTP) GetPort() int

func (*ParserHTTP) Parse

func (that *ParserHTTP) Parse(rawUri string)

func (*ParserHTTP) Show

func (that *ParserHTTP) Show()

type ParserSS

type ParserSS struct {
	Address  string
	Port     int
	Method   string
	Password string

	Host     string
	Mode     string
	Mux      string
	Path     string
	Plugin   string
	OBFS     string
	OBFSHost string

	*StreamField
}

func (*ParserSS) GetAddr

func (that *ParserSS) GetAddr() string

func (*ParserSS) GetPort

func (that *ParserSS) GetPort() int

func (*ParserSS) Parse

func (that *ParserSS) Parse(rawUri string)

func (*ParserSS) Show

func (that *ParserSS) Show()

type ParserSocks

type ParserSocks struct {
	Address string
	Port    int
	User    string
	Pass    string
	*StreamField
}

func (*ParserSocks) GetAddr

func (that *ParserSocks) GetAddr() string

func (*ParserSocks) GetPort

func (that *ParserSocks) GetPort() int

func (*ParserSocks) Parse

func (that *ParserSocks) Parse(rawUri string)

func (*ParserSocks) Show

func (that *ParserSocks) Show()

type ParserTrojan

type ParserTrojan struct {
	Address  string
	Port     int
	Password string

	*StreamField
}

func (*ParserTrojan) GetAddr

func (that *ParserTrojan) GetAddr() string

func (*ParserTrojan) GetPort

func (that *ParserTrojan) GetPort() int

func (*ParserTrojan) Parse

func (that *ParserTrojan) Parse(rawUri string)

func (*ParserTrojan) Show

func (that *ParserTrojan) Show()

type ParserVless

type ParserVless struct {
	Address    string
	Port       int
	UUID       string
	Encryption string
	Flow       string
	*StreamField
}

func (*ParserVless) GetAddr

func (that *ParserVless) GetAddr() string

func (*ParserVless) GetPort

func (that *ParserVless) GetPort() int

func (*ParserVless) Parse

func (that *ParserVless) Parse(rawUri string)

func (*ParserVless) Show

func (that *ParserVless) Show()

type ParserVmess

type ParserVmess struct {
	Address  string
	Port     int
	UUID     string
	Security string
	AID      string

	Nation         string
	Path           string
	PS             string
	ServerPort     string
	SkipCertVerify bool
	TestName       string
	V              string

	*StreamField
}

func (*ParserVmess) GetAddr

func (that *ParserVmess) GetAddr() string

func (*ParserVmess) GetPort

func (that *ParserVmess) GetPort() int

func (*ParserVmess) Parse

func (that *ParserVmess) Parse(rawUri string)

func (*ParserVmess) Show

func (that *ParserVmess) Show()

type ParserWireguard

type ParserWireguard struct {
	SecretKey      string   `json:"secretKey"`
	Address        []string `json:"address,omitempty"`
	Peers          []Peer   `json:"peers"`
	NoKernelTun    bool     `json:"noKernelTun,omitempty"`
	MTU            int      `json:"mtu,omitempty"`
	Reserved       []int    `json:"reserved,omitempty"`
	Workers        int      `json:"workers,omitempty"`
	DomainStrategy string   `json:"domainStrategy,omitempty"`
	*StreamField
}

func (*ParserWireguard) GetAddr

func (that *ParserWireguard) GetAddr() string

func (*ParserWireguard) GetPort

func (that *ParserWireguard) GetPort() int

func (*ParserWireguard) Parse

func (that *ParserWireguard) Parse(rawUri string)

func (*ParserWireguard) Show

func (that *ParserWireguard) Show()

type Peer

type Peer struct {
	Endpoint     string   `json:"endpoint"`
	PublicKey    string   `json:"publicKey"`
	PreSharedKey string   `json:"preSharedKey,omitempty"`
	KeepAlive    int      `json:"keepAlive,omitempty"`
	AllowedIPs   []string `json:"allowedIPs,omitempty"`
}

type StreamField

type StreamField struct {
	Network          string
	StreamSecurity   string
	Path             string
	Host             string
	TCPHeaderType    string
	GRPCServiceName  string
	GRPCMultiMode    string
	ServerName       string
	TLSALPN          string
	TLSAllowInsecure string
	Fingerprint      string
	RealityShortId   string
	RealitySpiderX   string
	RealityPublicKey string
	PacketEncoding   string
}

Jump to

Keyboard shortcuts

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