share

package
v1.260909.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAgeSecretKeyMissing     = errors.New("missing age secret key")
	ErrAgeSecretKeyInvalid     = errors.New("invalid or unsupported age secret key")
	ErrAgeDecryptFailed        = errors.New("unable to decrypt age subscription")
	ErrAgeArmorMalformed       = errors.New("malformed age armor")
	ErrAgePlaintextTooLarge    = errors.New("decrypted subscription exceeds the 16 MiB size limit")
	ErrAgePlaintextUnsupported = errors.New("decrypted subscription is unsupported")
	ErrAgeKeyTypeUnsupported   = errors.New("unsupported age key type")
)

Functions

func ConvertShareLinksToXrayJson

func ConvertShareLinksToXrayJson(links, secretKey string) (json.RawMessage, error)

ConvertShareLinksToXrayJson parses share links or an Age-encrypted subscription. The returned JSON contains only projected, buildable outbounds.

func ConvertXrayJsonToShareLinks(xrayBytes []byte) (string, error)

Convert XrayJson to share links. VMess will generate VMessAEAD link.

func FixWindowsReturn

func FixWindowsReturn(text string) string

FixWindowsReturn normalizes CRLF to LF (v2rayN exports on Windows).

Types

type AgeKeyPair added in v1.260909.0

type AgeKeyPair struct {
	SecretKey string
	PublicKey string
}

func GenerateAgeKeyPair added in v1.260909.0

func GenerateAgeKeyPair(keyType AgeKeyType) (*AgeKeyPair, error)

type AgeKeyType added in v1.260909.0

type AgeKeyType string
const (
	AgeKeyTypeX25519 AgeKeyType = "x25519"
	AgeKeyTypeHybrid AgeKeyType = "hybrid"
)

type XrayRawSettingsHeader

type XrayRawSettingsHeader struct {
	Type    string                        `json:"type,omitempty"`
	Request *XrayRawSettingsHeaderRequest `json:"request,omitempty"`
}

type XrayRawSettingsHeaderRequest

type XrayRawSettingsHeaderRequest struct {
	Path    []string                             `json:"path,omitempty"`
	Headers *XrayRawSettingsHeaderRequestHeaders `json:"headers,omitempty"`
}

type XrayRawSettingsHeaderRequestHeaders

type XrayRawSettingsHeaderRequestHeaders struct {
	Host []string `json:"Host,omitempty"`
}

Jump to

Keyboard shortcuts

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