Documentation
¶
Overview ¶
Package localproxy runs a built-in proxy on the tunnel's exit side, so a node can be its own backend: instead of forwarding to a separate service (xray, a panel, …) that has to be installed and kept running, the tunnel forwards to a proxy this binary serves itself.
It is optional and off by default. The operator picks the port — nothing is assumed — and maps a forwarded port to 127.0.0.1:<that port> like any other backend, so the tunnel engine is untouched.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Dir = app.ConfigDir
Dir is where the config lives; a variable so tests can point it elsewhere.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Enabled bool `json:"enabled"`
// Type is "socks5" or "http".
Type Kind `json:"type"`
// Port is chosen by the operator; there is no default, so nothing starts
// listening on a well-known port by surprise.
Port int `json:"port"`
// Username/Password gate the proxy. Empty means no authentication, which is
// safe here: the proxy binds loopback and is only reachable through the
// token-authenticated tunnel.
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
}
Config is the persisted built-in-proxy configuration.
Click to show internal directories.
Click to hide internal directories.