protocol

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	None        = ""
	Vmess       = "vmess"
	Shadowsocks = "ss"
	Trojan      = "trojan"
)

Variables

View Source
var ErrWrongProtocol = errors.New("wrong protocol")

Functions

This section is empty.

Types

type ShadowsocksConfig

type ShadowsocksConfig struct {
	Method   string
	Password string
	Hostname string
	Port     int
	Comment  string
}

func ParseShadowsocksUri

func ParseShadowsocksUri(uri string) (*ShadowsocksConfig, error)

type TrojanConfig added in v0.2.3

type TrojanConfig struct {
	Password string
	Host     string
	Port     int
}

func ParseTrojanUri added in v0.2.3

func ParseTrojanUri(uri string) (*TrojanConfig, error)

type Type

type Type string

func GetProtocol

func GetProtocol(uri string) (Type, error)

type VmessConfig added in v0.2.2

type VmessConfig struct {
	V    string      `json:"v"`
	Ps   string      `json:"ps"`
	Add  string      `json:"add"`
	Port json.Number `json:"port"`
	Id   string      `json:"id"`
	Aid  json.Number `json:"aid"`
	Scy  string      `json:"scy"`
	Net  string      `json:"net"`
	Type string      `json:"type"`
	Host string      `json:"host"`
	Path string      `json:"path"`
	Tls  string      `json:"tls"`
	Sni  string      `json:"sni"`
}

func ParseVmessUri added in v0.2.2

func ParseVmessUri(uri string) (*VmessConfig, error)

Jump to

Keyboard shortcuts

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