Documentation
¶
Overview ¶
Package integrate detects installed proxy clients (Xray, v2ray, sing-box, NekoBox) and patches their config so their outbound server address becomes 127.0.0.1:40443 (snix's listen address) while the real upstream address is stored in snix's own config.
Every Patch() call:
- backs up the original config to <path>.bak before writing
- preserves unrelated fields by round-tripping through a generic map
- returns an error before writing anything if the config is structurally unexpected (safer to fail than to corrupt).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// Name is a short label ("xray", "v2ray", "sing-box", "nekobox").
Name string
// Binary is the absolute path to the executable (diagnostic only).
Binary string
// ConfigPath is the file we would patch.
ConfigPath string
// Patch rewrites the config so the client's outbound server is
// snix's listen address. origHost+origPort is the user's real proxy
// server address (what snix will forward to). Returns an error if
// the config doesn't match the expected shape; the backup is always
// written before any modification.
Patch func(origHost string, origPort uint16) error
}
Client describes one detected proxy client's install.
Click to show internal directories.
Click to hide internal directories.