Documentation
¶
Index ¶
Constants ¶
View Source
const XrayFWMark int32 = 255
XrayFWMark is set on all outbound sockets so policy routing can exempt Xray's own traffic from the TUN interface when system proxy is active.
Variables ¶
This section is empty.
Functions ¶
func CleanupStaleProxy ¶
func CleanupStaleProxy(_ int)
CleanupStaleProxy removes routing rules left over from a previous crash. The TUN interface itself vanishes automatically when the process that owned the fd dies, so only the ip rules need cleaning up.
func DisableStartup ¶
func DisableStartup() error
func DisableSystemProxy ¶
func DisableSystemProxy()
func EnableStartup ¶
func EnableStartup() error
func EnableSystemProxy ¶
func NetAdminAvailable ¶
func NetAdminAvailable() bool
func StartupEnabled ¶
func StartupEnabled() bool
func SystemProxyAvailable ¶
func SystemProxyAvailable() bool
Types ¶
type Deps ¶
type Deps struct {
ConfigFiles *cmdarg.Arg
DefaultKey string // baked-in default (from -X main.defaultConfigFiles=…)
Port *int
// AutoEnable starts the proxy immediately on launch (set via -X main.defaultEnabled=true).
AutoEnable bool
// AutoSysProxy also enables system-wide proxy on launch; implies AutoEnable.
AutoSysProxy bool
// AutoStartup registers the binary as a login item on launch (macOS only).
AutoStartup bool
// StartXray creates and starts the proxy server; returns a handle to close it.
StartXray func() (io.Closer, error)
ValidateKey func(string) error
ParseName func(string) string
PrintVersion func()
}
Deps carries everything the UI needs from the main package.
Click to show internal directories.
Click to hide internal directories.