common

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeCommon

func DecodeCommon(content string) (*sub.DecodeResult, error)

Decode parses subscription content into outbound handler configurations

func ParseAnytls

func ParseAnytls(link string) (*configs.OutboundHandlerConfig, error)
func ParseHysteriaFromLink(link string) (*configs.OutboundHandlerConfig, error)

TODO: pinSHA256 hysteria2://letmein@example.com:123,5000-6000/?insecure=1&obfs= salamander&obfs-password=gawrgura&pinSHA256=deadbeef&sni=real.example.com

func ParseSocks5FromLink(link string) (*configs.OutboundHandlerConfig, error)
func ParseSsFromLink(link string) (*configs.OutboundHandlerConfig, error)

ParseSsFromLink parses a Shadowsocks configuration from a URI link

func ParseTrojan

func ParseTrojan(link string) (*configs.OutboundHandlerConfig, error)
func ParseVlessFromLink(link string) (*configs.OutboundHandlerConfig, error)

Types

type SsConfig

type SsConfig struct {
	Cipher   string
	Password string
	Address  string
	Port     string
	Remark   string
}

SsConfig represents a Shadowsocks configuration

func ParseSsFromLink0

func ParseSsFromLink0(link string) (*SsConfig, error)

ParseSsFromLink parses a Shadowsocks configuration from a URI link

type VmessConfig

type VmessConfig struct {
	V    json.Number `json:"v,omitempty"`
	PS   string      `json:"ps,omitempty"`
	Add  string      `json:"add"`
	Port json.Number `json:"port"`
	ID   string      `json:"id,omitempty"`
	Aid  json.Number `json:"aid,omitempty"`
	Scy  string      `json:"scy,omitempty"`
	Net  string      `json:"net,omitempty"`
	Type string      `json:"type,omitempty"`
	Host string      `json:"host,omitempty"`
	Path string      `json:"path,omitempty"`
	TLS  string      `json:"tls,omitempty"`
	SNI  string      `json:"sni,omitempty"`
	ALPN string      `json:"alpn,omitempty"`
	FP   string      `json:"fp,omitempty"`
}

VmessConfig represents a Vmess protocol configuration

func ParseVmessFromJSON

func ParseVmessFromJSON(data []byte) (*VmessConfig, error)

ParseVmessFromJSON parses a VmessConfig from JSON

func (*VmessConfig) ToProxyHandlerConfig

func (v *VmessConfig) ToProxyHandlerConfig() (*configs.OutboundHandlerConfig, error)

ToProxyHandlerConfig converts VmessConfig to OutboundHandlerConfig

Jump to

Keyboard shortcuts

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