share

package
v1.260627.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertShareLinksToXrayJson

func ConvertShareLinksToXrayJson(links string) (*conf.Config, error)

ConvertShareLinksToXrayJson parses:

  • a single Xray JSON object (starts with '{')
  • plain v2rayN-style lines (vless/vmess/ss/socks/trojan/hy2…)
  • one base64 blob that decodes to Xray JSON, share lines, or Clash YAML
  • Clash / Clash.Meta YAML (proxies:)
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 ClashProxy

type ClashProxy struct {
	Name       string `yaml:"name,omitempty"`
	Type       string `yaml:"type,omitempty"`
	Server     string `yaml:"server,omitempty"`
	Port       uint16 `yaml:"port,omitempty"`
	Uuid       string `yaml:"uuid,omitempty"`
	Cipher     string `yaml:"cipher,omitempty"`
	Username   string `yaml:"username,omitempty"`
	Password   string `yaml:"password,omitempty"`
	Encryption string `yaml:"encryption,omitempty"`

	Ports        string `yaml:"ports,omitempty"`
	HopInterval  int32  `yaml:"hop-interval,omitempty"`
	Up           string `yaml:"up,omitempty"`
	Down         string `yaml:"down,omitempty"`
	Obfs         string `yaml:"obfs,omitempty"`
	ObfsPassword string `yaml:"obfs-password,omitempty"`

	Udp        bool `yaml:"udp,omitempty"`
	UdpOverTcp bool `yaml:"udp-over-tcp,omitempty"`

	Tls            bool     `yaml:"tls,omitempty"`
	SkipCertVerify bool     `yaml:"skip-cert-verify,omitempty"`
	Servername     string   `yaml:"servername,omitempty"`
	Sni            string   `yaml:"sni,omitempty"`
	Alpn           []string `yaml:"alpn,omitempty"`

	Fingerprint       string                 `yaml:"fingerprint,omitempty"`
	ClientFingerprint string                 `yaml:"client-fingerprint,omitempty"`
	Flow              string                 `yaml:"flow,omitempty"`
	RealityOpts       *ClashProxyRealityOpts `yaml:"reality-opts,omitempty"`

	Network    string                `yaml:"network,omitempty"`
	Plugin     string                `yaml:"plugin,omitempty"`
	PluginOpts *ClashProxyPluginOpts `yaml:"plugin-opts,omitempty"`
	EchOpts    *ClashProxyEchOpts    `yaml:"ech-opts,omitempty"`
	WsOpts     *ClashProxyWsOpts     `yaml:"ws-opts,omitempty"`
	GrpcOpts   *ClashProxyGrpcOpts   `yaml:"grpc-opts,omitempty"`
	XhttpOpts  *ClashProxyXhttpOpts  `yaml:"xhttp-opts,omitempty"`
}

type ClashProxyEchOpts

type ClashProxyEchOpts struct {
	Enable bool   `yaml:"enable,omitempty"`
	Config string `yaml:"config,omitempty"`
}

type ClashProxyGrpcOpts

type ClashProxyGrpcOpts struct {
	GrpcServiceName string `yaml:"grpc-service-name,omitempty"`
}

type ClashProxyPluginOpts

type ClashProxyPluginOpts struct {
	Mode           string             `yaml:"mode,omitempty"`
	Tls            bool               `yaml:"tls,omitempty"`
	Fingerprint    string             `yaml:"fingerprint,omitempty"`
	EchOpts        *ClashProxyEchOpts `yaml:"ech-opts,omitempty"`
	SkipCertVerify bool               `yaml:"skip-cert-verify,omitempty"`
	Host           string             `yaml:"host,omitempty"`
	Path           string             `yaml:"path,omitempty"`
	Mux            bool               `yaml:"mux,omitempty"`
}

type ClashProxyRealityOpts

type ClashProxyRealityOpts struct {
	PublicKey string `yaml:"public-key,omitempty"`
	ShortId   string `yaml:"short-id,omitempty"`
}

type ClashProxyWsOpts

type ClashProxyWsOpts struct {
	Path    string                   `yaml:"path,omitempty"`
	Headers *ClashProxyWsOptsHeaders `yaml:"headers,omitempty"`
}

type ClashProxyWsOptsHeaders

type ClashProxyWsOptsHeaders struct {
	Host string `yaml:"Host,omitempty"`
}

type ClashProxyXhttpOpts

type ClashProxyXhttpOpts struct {
	Path               string                               `yaml:"path,omitempty"`
	Host               string                               `yaml:"host,omitempty"`
	Mode               string                               `yaml:"mode,omitempty"`
	Headers            map[string]string                    `yaml:"headers,omitempty"`
	NoGrpcHeader       bool                                 `yaml:"no-grpc-header,omitempty"`
	XPaddingBytes      string                               `yaml:"x-padding-bytes,omitempty"`
	ScMaxEachPostBytes string                               `yaml:"sc-max-each-post-bytes,omitempty"`
	ReuseSettings      *ClashProxyXhttpOptsXMUX             `yaml:"reuse-settings,omitempty"`
	DownloadSettings   *ClashProxyXhttpOptsDownloadSettings `yaml:"download-settings,omitempty"`
}

type ClashProxyXhttpOptsDownloadSettings

type ClashProxyXhttpOptsDownloadSettings struct {
	Path               string                   `yaml:"path,omitempty"`
	Host               string                   `yaml:"host,omitempty"`
	Mode               string                   `yaml:"mode,omitempty"`
	Headers            map[string]string        `yaml:"headers,omitempty"`
	NoGrpcHeader       bool                     `yaml:"no-grpc-header,omitempty"`
	XPaddingBytes      string                   `yaml:"x-padding-bytes,omitempty"`
	ScMaxEachPostBytes string                   `yaml:"sc-max-each-post-bytes,omitempty"`
	ReuseSettings      *ClashProxyXhttpOptsXMUX `yaml:"reuse-settings,omitempty"`
	// proxy part
	Server            string                 `yaml:"server,omitempty"`
	Port              uint16                 `yaml:"port,omitempty"`
	Tls               bool                   `yaml:"tls,omitempty"`
	Alpn              []string               `yaml:"alpn,omitempty"`
	EchOpts           *ClashProxyEchOpts     `yaml:"ech-opts,omitempty"`
	RealityOpts       *ClashProxyRealityOpts `yaml:"reality-opts,omitempty"`
	SkipCertVerify    bool                   `yaml:"skip-cert-verify,omitempty"`
	Fingerprint       string                 `yaml:"fingerprint,omitempty"`
	Servername        string                 `yaml:"servername,omitempty"`
	ClientFingerprint string                 `yaml:"client-fingerprint,omitempty"`
}

type ClashProxyXhttpOptsXMUX

type ClashProxyXhttpOptsXMUX struct {
	MaxConnections   string `yaml:"max-connections,omitempty"`
	MaxConcurrency   string `yaml:"max-concurrency,omitempty"`
	CMaxReuseTimes   string `yaml:"c-max-reuse-times,omitempty"`
	HMaxRequestTimes string `yaml:"h-max-request-times,omitempty"`
	HMaxReusableSecs string `yaml:"h-max-reusable-secs,omitempty"`
}

type ClashYaml

type ClashYaml struct {
	Proxies []ClashProxy `yaml:"proxies,omitempty"`
}

type XrayFakeHeader

type XrayFakeHeader struct {
	Type string `json:"type,omitempty"`
}

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