decode

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const FILE_FORMAT_YAML = "yaml"

Variables

View Source
var TransportProtocolList []string = []string{
	"tcp",
	"websocket",
	"grpc",
}

Functions

func Base64StdDecode

func Base64StdDecode(s string) (string, error)

封装base64.StdEncoding进行解码,加入了长度补全,换行删除。当error时,返回输入和err

func Base64URLDecode

func Base64URLDecode(s string) (string, error)

封装base64.URLEncoding进行解码,加入了长度补全,换行删除。当error时,返回输入和err

func ParseSubscribeByRaw

func ParseSubscribeByRaw(data string) (dt string, err error)

func ParseSubscribeByUrl

func ParseSubscribeByUrl(url string, proxy string) (dt string, rawdt string, err error)

func TrojanToV2ray added in v1.8.3

func TrojanToV2ray(tro Trojan, nd *V2raySsNode)

Types

type ClashProxyNode added in v1.8.0

type ClashProxyNode struct {
	Name           string `yaml:"name"`
	Type           string `yaml:"type"`
	Server         string `yaml:"server"`
	Port           int    `yaml:"port"`
	Password       string `yaml:"password"`
	Udp            bool   `yaml:"udp"`
	Sni            string `yaml:"sni"`
	SkipCertVerify bool   `yaml:"skip-cert-verify"`
}

{ name: '🇭🇰 香港 02', type: trojan, server: h00kgbb2.star11.xyz, port: 60011, password: 23d7e3f1-c61c-4fbd-a04e-858b41248bb9, udp: true, sni: g.alicdn.com, skip-cert-verify: true }

type ClashSubscribeSource added in v1.8.0

type ClashSubscribeSource struct {
	Proxies []ClashProxyNode `yaml:"proxies"`
}

type Shadowsocks

type Shadowsocks struct {
	TransportStream                   StreamConfig
	Address, Password, Cipher, Plugin string
	Title                             string
	Port                              int
}

"aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "plain", "none"

func ParseShadowsocks

func ParseShadowsocks(u string) (ss Shadowsocks, err error)

ParseShadowsocks. parse shadowsocks protocol url string. begin with: ss://

type StreamConfig

type StreamConfig struct {
	Protocol, Security, Path string
}

type Trojan

type Trojan struct {
	TransportStream   StreamConfig
	Address, Password string
	Title             string
	Port              int
	Sni               string `json:"sni"`
	AllowInsecure     bool   `json:"allowInsecure"`
	Alpn              string `json:"alpn,omitempty"`
}

func ParseTrojanUrl added in v1.8.3

func ParseTrojanUrl(d string) (tr Trojan, err error)

ParseTrojanUrl 解析Url格式的节点数据

type V2raySsNode added in v1.8.3

type V2raySsNode struct {
	Protocol, Add, Host, Id, Net, Path, Ps, Tls, Type string
	V, Aid, Port                                      json.Number
}

"protocol":"vmess"

func ParseClashSubscribe added in v1.8.0

func ParseClashSubscribe(b []byte) []V2raySsNode

Jump to

Keyboard shortcuts

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