Documentation
¶
Index ¶
- func ConvertShareLinksToXrayJson(links string) (*conf.Config, error)
- func ConvertXrayJsonToShareLinks(xrayBytes []byte) (string, error)
- func FixWindowsReturn(text string) string
- type ClashProxy
- type ClashProxyEchOpts
- type ClashProxyGrpcOpts
- type ClashProxyPluginOpts
- type ClashProxyRealityOpts
- type ClashProxyWsOpts
- type ClashProxyWsOptsHeaders
- type ClashProxyXhttpOpts
- type ClashProxyXhttpOptsDownloadSettings
- type ClashProxyXhttpOptsXMUX
- type ClashYaml
- type XrayFakeHeader
- type XrayRawSettingsHeader
- type XrayRawSettingsHeaderRequest
- type XrayRawSettingsHeaderRequestHeaders
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertShareLinksToXrayJson ¶
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 ¶
Convert XrayJson to share links. VMess will generate VMessAEAD link.
func FixWindowsReturn ¶
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 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 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"`
}
Click to show internal directories.
Click to hide internal directories.