Documentation
¶
Index ¶
- func Close(proxyURL string)
- func CloseAll()
- func DialSSR(u *url.URL, o *proxyclient.Options) (http.RoundTripper, error)
- func DialTrojan(u *url.URL, o *proxyclient.Options) (http.RoundTripper, error)
- func DialVless(u *url.URL, o *proxyclient.Options) (http.RoundTripper, error)
- func DialVmess(u *url.URL, o *proxyclient.Options) (http.RoundTripper, error)
- func SSRToXRay(u *url.URL, port int) ([]byte, int, error)
- func StartSSR(u *url.URL, port int) (*core.Instance, int, error)
- func StartTrojan(u *url.URL, port int) (*core.Instance, int, error)
- func StartVless(u *url.URL, port int) (*core.Instance, int, error)
- func StartVmess(u *url.URL, port int) (*core.Instance, int, error)
- func TrojanToXRay(u *url.URL, port int) ([]byte, int, error)
- func VlessToXRay(vu *VlessURL, port int) ([]byte, int, error)
- func VmessToXRay(vmess *VmessConfig, port int) ([]byte, int, error)
- type DNSConfig
- type GRPCSettings
- type HTTPSettings
- type Header
- type Inbound
- type KCPSettings
- type LogConfig
- type Mux
- type Outbound
- type QUICSettings
- type RealitySettings
- type RoutingConfig
- type RoutingRule
- type SSRConfig
- type SSRURL
- type Server
- type Sniffing
- type SocksSetting
- type StreamSettings
- type TCPSettings
- type TLSSettings
- type TrojanConfig
- type TrojanURL
- type VlessConfig
- type VlessURL
- type VmessConfig
- type VmessURL
- type WSSettings
- type XHTTPSettings
- type XRayConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialSSR ¶ added in v0.0.5
func DialSSR(u *url.URL, o *proxyclient.Options) (http.RoundTripper, error)
DialSSR creates a custom transport that dials directly to the v2ray server instead of using a local SOCKS proxy.
func DialTrojan ¶ added in v0.0.5
func DialTrojan(u *url.URL, o *proxyclient.Options) (http.RoundTripper, error)
DialTrojan creates a custom transport that dials directly to the v2ray server instead of using a local SOCKS proxy.
func DialVless ¶ added in v0.0.5
func DialVless(u *url.URL, o *proxyclient.Options) (http.RoundTripper, error)
DialVless creates a custom transport that dials directly to the v2ray server instead of using a local SOCKS proxy.
func DialVmess ¶ added in v0.0.5
func DialVmess(u *url.URL, o *proxyclient.Options) (http.RoundTripper, error)
DialVmess creates a custom transport that dials directly to the v2ray server instead of using a local SOCKS proxy.
func StartTrojan ¶
StartTrojan starts a Trojan client and returns Xray instance and local SOCKS port
func StartVless ¶
StartVless starts a VLESS client and returns Xray instance and local SOCKS port
func StartVmess ¶
StartVmess starts a VMess client
func TrojanToXRay ¶
TrojanToXRay converts Trojan URL to Xray JSON configuration
func VlessToXRay ¶
VlessToXRay converts VLESS URL to Xray JSON configuration
func VmessToXRay ¶
func VmessToXRay(vmess *VmessConfig, port int) ([]byte, int, error)
VmessToXRay converts VMess URL to Xray JSON configuration
Types ¶
type GRPCSettings ¶
type HTTPSettings ¶
type Header ¶
type Header struct {
Type string `json:"type,omitempty"`
Request interface{} `json:"request,omitempty"`
Response interface{} `json:"response,omitempty"`
}
type KCPSettings ¶
type KCPSettings struct {
MTU int `json:"mtu,omitempty"`
TTI int `json:"tti,omitempty"`
UplinkCapacity int `json:"uplinkCapacity,omitempty"`
DownlinkCapacity int `json:"downlinkCapacity,omitempty"`
Congestion bool `json:"congestion,omitempty"`
ReadBufferSize int `json:"readBufferSize,omitempty"`
WriteBufferSize int `json:"writeBufferSize,omitempty"`
Header *Header `json:"header,omitempty"`
}
type Outbound ¶
type Outbound struct {
Tag string `json:"tag,omitempty"`
Protocol string `json:"protocol"`
Settings interface{} `json:"settings"`
StreamSettings *StreamSettings `json:"streamSettings,omitempty"`
Mux *Mux `json:"mux,omitempty"`
}
type QUICSettings ¶
type RealitySettings ¶
type RoutingConfig ¶
type RoutingConfig struct {
DomainStrategy string `json:"domainStrategy,omitempty"`
Rules []RoutingRule `json:"rules,omitempty"`
}
type RoutingRule ¶
type SSRConfig ¶
type SSRConfig struct {
Server string
Port int
Method string
Password string
Protocol string
ProtocolParam string
Obfs string
ObfsParam string
Name string
// contains filtered or unexported fields
}
SSRConfig stores ShadowsocksR URL parameters
type SocksSetting ¶
type StreamSettings ¶
type StreamSettings struct {
Network string `json:"network,omitempty"`
Security string `json:"security,omitempty"`
TLSSettings *TLSSettings `json:"tlsSettings,omitempty"`
TCPSettings *TCPSettings `json:"tcpSettings,omitempty"`
KCPSettings *KCPSettings `json:"kcpSettings,omitempty"`
WSSettings *WSSettings `json:"wsSettings,omitempty"`
HTTPSettings *HTTPSettings `json:"httpSettings,omitempty"`
QUICSettings *QUICSettings `json:"quicSettings,omitempty"`
GRPCSettings *GRPCSettings `json:"grpcSettings,omitempty"`
XTLSSettings *TLSSettings `json:"xtlsSettings,omitempty"` // Added XTLS support
RealitySettings *RealitySettings `json:"realitySettings,omitempty"` // Added Reality support
XHTTPSettings *XHTTPSettings `json:"xhttpSettings,omitempty"` // Added XHTTP support
}
type TCPSettings ¶
type TCPSettings struct {
Header *Header `json:"header,omitempty"`
}
type TLSSettings ¶
type TrojanConfig ¶
type TrojanConfig struct {
Password string
Address string
Port int
Flow string
Type string
Security string
Path string
Host string
SNI string
ALPN string
Fingerprint string
ServiceName string
AllowInsecure bool // Controls whether to allow insecure TLS connections
Remark string
// contains filtered or unexported fields
}
TrojanConfig stores Trojan URL parameters
type TrojanURL ¶ added in v0.0.4
type TrojanURL struct {
Config *TrojanConfig
}
func ParseTrojanURL ¶ added in v0.0.4
ParseTrojanURL parses Trojan URL trojan://password@host:port?security=tls&type=tcp&sni=example.com...
type VlessConfig ¶
type VlessConfig struct {
UUID string
Address string
Port int
Encryption string
Flow string
Type string
Security string
Path string
Host string
SNI string
ALPN string
Fingerprint string
PublicKey string
ShortID string
SpiderX string
ServiceName string
AllowInsecure bool // Controls whether to allow insecure TLS connections
Remark string
// contains filtered or unexported fields
}
VlessConfig stores VLESS URL parameters
type VlessURL ¶ added in v0.0.3
type VlessURL struct {
Config *VlessConfig
}
func ParseVlessURL ¶ added in v0.0.3
ParseVlessURL parses VLESS URL vless://uuid@host:port?encryption=none&type=tcp&security=tls&sni=example.com...
type VmessConfig ¶
type VmessConfig struct {
V proxyclient.Int `json:"v"`
PS string `json:"ps"` // Remarks
Add string `json:"add"` // Address
Port proxyclient.Int `json:"port"` // Port
ID string `json:"id"` // UUID
Aid proxyclient.Int `json:"aid"` // AlterID
Net string `json:"net"` // Transport protocol
Type string `json:"type"` // Camouflage type
Host string `json:"host"` // Camouflage domain
Path string `json:"path"` // WebSocket path
TLS proxyclient.String `json:"tls"` // TLS
SNI string `json:"sni"` // TLS SNI
Alpn string `json:"alpn"` // ALPN
Flow string `json:"flow"` // XTLS Flow
Fp string `json:"fp"` // Fingerprint
PbK string `json:"pbk"` // PublicKey (Reality)
Sid string `json:"sid"` // ShortID (Reality)
SpX string `json:"spx"` // SpiderX (Reality)
Security string `json:"security"` // Encryption method
XHTTPVer string `json:"xver"` // XHTTP version, "h2" or "h3"
AllowInsecure bool `json:"skip_cert_verify"` // Controls whether to allow insecure TLS connections
// contains filtered or unexported fields
}
VmessConfig stores VMess URL parameters
type VmessURL ¶ added in v0.0.3
type VmessURL struct {
Config *VmessConfig
}
type WSSettings ¶
type WSSettings struct {
Path string `json:"path,omitempty"`
Host string `json:"host,omitempty"` // Added independent Host field
Headers map[string]string `json:"headers,omitempty"`
}
Updated WSSettings structure
type XHTTPSettings ¶
type XHTTPSettings struct {
Host string `json:"host,omitempty"`
Path string `json:"path,omitempty"`
Method string `json:"method,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Version string `json:"version,omitempty"` // "h2" or "h3"
}
Added new XHTTP settings structure
type XRayConfig ¶
type XRayConfig struct {
Log *LogConfig `json:"log,omitempty"`
DNS *DNSConfig `json:"dns,omitempty"`
Routing *RoutingConfig `json:"routing,omitempty"`
Inbounds []Inbound `json:"inbounds"`
Outbounds []Outbound `json:"outbounds"`
}
General configuration structure, matching the Xray configuration format