Documentation
¶
Index ¶
- Constants
- func ConvertShareTextToXrayJson(textPath string, xrayPath string) string
- func ConvertXrayJsonToShareText(xrayPath string, textPath string) string
- func GetFreePorts(count int) string
- func InitForceFree(maxMemory int64, interval int)
- func MeasureDelay(timeout int, url string, times int, proxy string) (int64, string, error)
- func TcpPing(timeout int, server string, times int) string
- func WriteBytes(bytes []byte, path string) error
- func WriteText(text string, path string) error
- type ClashProxy
- type ClashProxyGrpcOpts
- type ClashProxyH2Opts
- type ClashProxyPluginOpts
- type ClashProxyRealityOpts
- type ClashProxyWsOpts
- type ClashProxyWsOptsHeaders
- type ClashYaml
- type XrayFakeHeader
- type XrayGrpcSettings
- type XrayHttpSettings
- type XrayJson
- type XrayKcpSettings
- type XrayOutbound
- type XrayQuicSettings
- type XrayRealitySettings
- type XrayShadowsocks
- type XrayShadowsocksServer
- type XraySocks
- type XraySocksServer
- type XraySocksServerUser
- type XrayStreamSettings
- type XrayTcpSettings
- type XrayTcpSettingsHeader
- type XrayTcpSettingsHeaderRequest
- type XrayTcpSettingsHeaderRequestHeaders
- type XrayTlsSettings
- type XrayTrojan
- type XrayTrojanServer
- type XrayVLESS
- type XrayVLESSVnext
- type XrayVLESSVnextUser
- type XrayVMess
- type XrayVMessVnext
- type XrayVMessVnextUser
- type XrayWsSettings
- type XrayWsSettingsHeaders
Constants ¶
View Source
const ( PingDelayTimeout int64 = 11000 PingDelayError int64 = 10000 )
Variables ¶
This section is empty.
Functions ¶
func ConvertShareTextToXrayJson ¶
Convert share text to XrayJson support XrayJson, v2rayN plain text, v2rayN base64 text, Clash yaml, Clash.Meta yaml
func ConvertXrayJsonToShareText ¶
Convert XrayJson to share links. VMess will generate VMessAEAD link.
func GetFreePorts ¶
https://github.com/phayes/freeport/blob/master/freeport.go GetFreePort asks the kernel for free open ports that are ready to use.
func InitForceFree ¶
func MeasureDelay ¶
func TcpPing ¶
Find the delay of some outbound. timeout means how long the tcp connection will be cancelled if no response, in units of seconds. server means the destination we use to test speed, like "8.8.8.8:853". times means how many times we should test the server.
func WriteBytes ¶
Types ¶
type ClashProxy ¶
type ClashProxy struct {
Name string `yaml:"name,omitempty"`
Type string `yaml:"type,omitempty"`
Server string `yaml:"server,omitempty"`
Port int `yaml:"port,omitempty"`
Uuid string `yaml:"uuid,omitempty"`
Cipher string `yaml:"cipher,omitempty"`
Username string `yaml:"username,omitempty"`
Password string `yaml:"password,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"`
WsOpts *ClashProxyWsOpts `yaml:"ws-opts,omitempty"`
H2Opts *ClashProxyH2Opts `yaml:"h2-opts,omitempty"`
GrpcOpts *ClashProxyGrpcOpts `yaml:"grpc-opts,omitempty"`
}
type ClashProxyGrpcOpts ¶
type ClashProxyGrpcOpts struct {
GrpcServiceName string `yaml:"grpc-service-name,omitempty"`
}
type ClashProxyH2Opts ¶
type ClashProxyPluginOpts ¶
type ClashProxyRealityOpts ¶
type ClashProxyWsOpts ¶
type ClashProxyWsOpts struct {
Path string `yaml:"path,omitempty"`
Headers *ClashProxyWsOptsHeaders `yaml:"headers,omitempty"`
MaxEarlyData int `yaml:"max-early-data,omitempty"`
EarlyDataHeaderName string `yaml:"early-data-header-name,omitempty"`
}
type ClashProxyWsOptsHeaders ¶
type ClashProxyWsOptsHeaders struct {
Host string `yaml:"Host,omitempty"`
}
type ClashYaml ¶
type ClashYaml struct {
Proxies []ClashProxy `yaml:"proxies,omitempty"`
}
type XrayFakeHeader ¶
type XrayFakeHeader struct {
Type string `json:"type,omitempty"`
}
type XrayGrpcSettings ¶
type XrayHttpSettings ¶
type XrayJson ¶
type XrayJson struct {
Outbounds []XrayOutbound `json:"outbounds,omitempty"`
}
func (XrayJson) FlattenOutbounds ¶
func (xray XrayJson) FlattenOutbounds() []XrayOutbound
type XrayKcpSettings ¶
type XrayKcpSettings struct {
Header *XrayFakeHeader `json:"header,omitempty"`
Seed string `json:"seed,omitempty"`
}
type XrayOutbound ¶
type XrayOutbound struct {
Name string `json:"name,omitempty"`
Protocol string `json:"protocol,omitempty"`
Settings *json.RawMessage `json:"settings,omitempty"`
StreamSettings *XrayStreamSettings `json:"streamSettings,omitempty"`
}
Keep same with Xray Config, but add name for sharing.
type XrayQuicSettings ¶
type XrayQuicSettings struct {
Security string `json:"security,omitempty"`
Key string `json:"key,omitempty"`
Header *XrayFakeHeader `json:"header,omitempty"`
}
type XrayRealitySettings ¶
type XrayShadowsocks ¶
type XrayShadowsocks struct {
Servers []XrayShadowsocksServer `json:"servers,omitempty"`
}
type XrayShadowsocksServer ¶
type XraySocks ¶
type XraySocks struct {
Servers []XraySocksServer `json:"servers,omitempty"`
}
type XraySocksServer ¶
type XraySocksServer struct {
Address string `json:"address,omitempty"`
Port int `json:"port,omitempty"`
Users []XraySocksServerUser `json:"users,omitempty"`
}
type XraySocksServerUser ¶
type XrayStreamSettings ¶
type XrayStreamSettings struct {
Network string `json:"network,omitempty"`
Security string `json:"security,omitempty"`
TlsSettings *XrayTlsSettings `json:"tlsSettings,omitempty"`
RealitySettings *XrayRealitySettings `json:"realitySettings,omitempty"`
TcpSettings *XrayTcpSettings `json:"tcpSettings,omitempty"`
KcpSettings *XrayKcpSettings `json:"kcpSettings,omitempty"`
WsSettings *XrayWsSettings `json:"wsSettings,omitempty"`
HttpSettings *XrayHttpSettings `json:"httpSettings,omitempty"`
QuicSettings *XrayQuicSettings `json:"quicSettings,omitempty"`
GrpcSettings *XrayGrpcSettings `json:"grpcSettings,omitempty"`
}
type XrayTcpSettings ¶
type XrayTcpSettings struct {
Header *XrayTcpSettingsHeader `json:"header,omitempty"`
}
type XrayTcpSettingsHeader ¶
type XrayTcpSettingsHeader struct {
Type string `json:"type,omitempty"`
Request *XrayTcpSettingsHeaderRequest `json:"request,omitempty"`
}
type XrayTcpSettingsHeaderRequest ¶
type XrayTcpSettingsHeaderRequest struct {
Path []string `json:"path,omitempty"`
Headers *XrayTcpSettingsHeaderRequestHeaders `json:"headers,omitempty"`
}
type XrayTcpSettingsHeaderRequestHeaders ¶
type XrayTcpSettingsHeaderRequestHeaders struct {
Host []string `json:"Host,omitempty"`
}
type XrayTlsSettings ¶
type XrayTrojan ¶
type XrayTrojan struct {
Servers []XrayTrojanServer `json:"servers,omitempty"`
}
type XrayTrojanServer ¶
type XrayVLESS ¶
type XrayVLESS struct {
Vnext []XrayVLESSVnext `json:"vnext,omitempty"`
}
type XrayVLESSVnext ¶
type XrayVLESSVnext struct {
Address string `json:"address,omitempty"`
Port int `json:"port,omitempty"`
Users []XrayVLESSVnextUser `json:"users,omitempty"`
}
type XrayVLESSVnextUser ¶
type XrayVMess ¶
type XrayVMess struct {
Vnext []XrayVMessVnext `json:"vnext,omitempty"`
}
type XrayVMessVnext ¶
type XrayVMessVnext struct {
Address string `json:"address,omitempty"`
Port int `json:"port,omitempty"`
Users []XrayVMessVnextUser `json:"users,omitempty"`
}
type XrayVMessVnextUser ¶
type XrayWsSettings ¶
type XrayWsSettings struct {
Path string `json:"path,omitempty"`
Headers *XrayWsSettingsHeaders `json:"headers,omitempty"`
}
type XrayWsSettingsHeaders ¶
type XrayWsSettingsHeaders struct {
Host string `json:"Host,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.