parser

package
v0.0.0-...-f887393 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemeSS        string = "ss://"
	SchemeSSR       string = "ssr://"
	SchemeTrojan    string = "trojan://"
	SchemeVless     string = "vless://"
	SchemeVmess     string = "vmess://"
	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":                     {},
}
View Source
var SSRMethod map[string]struct{} = map[string]struct{}{
	"aes-128-ctr":   {},
	"aes-192-ctr":   {},
	"aes-256-ctr":   {},
	"aes-128-cfb":   {},
	"aes-192-cfb":   {},
	"aes-256-cfb":   {},
	"rc4-md5":       {},
	"chacha20-ietf": {},
	"xchacha20":     {},
}
View Source
var SSROBFS map[string]struct{} = map[string]struct{}{
	"plain":              {},
	"http_simple":        {},
	"http_post":          {},
	"random_head":        {},
	"tls1.2_ticket_auth": {},
}

Functions

func GetVpnScheme

func GetVpnScheme(rawUri string) string

func HandleQuery

func HandleQuery(rawUri string) (result string)

func ParseRawUri

func ParseRawUri(rawUri string) (result string)

func SSRTest

func SSRTest()

func TestWireguard

func TestWireguard()

func TrojanTest

func TrojanTest()

func VlessTest

func VlessTest()

func VmessTest

func VmessTest()

Types

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 ParserSSR

type ParserSSR struct {
	Address    string
	Port       int
	Method     string
	Password   string
	OBFS       string
	Proto      string
	OBFSParam  string
	ProtoParam string

	*StreamField
}

func (*ParserSSR) GetAddr

func (that *ParserSSR) GetAddr() string

func (*ParserSSR) GetPort

func (that *ParserSSR) GetPort() int

func (*ParserSSR) Parse

func (that *ParserSSR) Parse(rawUri string)

func (*ParserSSR) Show

func (that *ParserSSR) 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 ParserWirguard

type ParserWirguard struct {
	PrivateKey string   `koanf,json:"private_key"`
	AddrV4     string   `koanf,json:"addr_v4"`
	AddrV6     string   `koanf,json:"addr_v6"`
	DNS        string   `koanf,json:"dns"`
	MTU        int      `koanf,json:"mtu"`
	PublicKey  string   `koanf,json:"public_key"`
	AllowedIPs []string `koanf,json:"allowed_ips"`
	Endpoint   string   `koanf,json:"endpoint"`
	ClientID   string   `koanf,json:"client_id"`
	DeviceName string   `koanf,json:"device_name"`
	Reserved   []int    `koanf,json:"reserved"`
	Address    string   `koanf,json:"address"`
	Port       int      `koanf,json:"port"`
}

func (*ParserWirguard) GetAddr

func (that *ParserWirguard) GetAddr() string

func (*ParserWirguard) GetPort

func (that *ParserWirguard) GetPort() int

func (*ParserWirguard) Parse

func (that *ParserWirguard) Parse(rawUri string)

func (*ParserWirguard) Show

func (that *ParserWirguard) Show()

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