Every failover health check connected to www.google.com:443 and asked
1.1.1.1:53 about www.google.com, through every actor, direct ones
included, on a timer. That is a fixed pattern an observer can match,
direct DNS in the clear, and where Google is blocked a direct actor was
always marked down. The TLS check also sent "GET / HTTP/1.1" with no Host
header, which no browser does.
healthCheckTcpDestination (host:port) and healthCheckUdpDestination
(ip:port), health-check-tcp-destination and health-check-udp-destination
in .conf, now set them; the defaults are unchanged. The DNS check asks
for the TCP destination's name, or the root zone when that is an
address, and the HTTP request carries a Host header, with the port when
it is not 443. An IPv6 address must be in brackets. A malformed value
fails at startup.
A test runs real checks through a direct actor against local listeners.
The failover outbound has always supported a last resort, used when the
last health check found every actor down, but neither config format
passed it on: JSON had no key for it and .conf parsed last-resort and
dropped it. The previous commit took that for a missing feature and only
warned. JSON now takes lastResort, and .conf's last-resort is passed on.
The outbound manager also took a last-resort tag it had not loaded yet
for none at all. It now waits for that tag as it does for actors. A tag
that names no outbound is a configuration error, rather than something
to wait for until the group quietly fails to load. And any outbound
still not loaded at the end -- one it uses is missing, or the build
leaves its protocol out -- is now named in a warning instead of
vanishing.
The docs say what a direct last resort means: everything goes direct
whenever the proxy is found down.
A socks inbound with a username checked it on SOCKS5 TCP and nowhere
else. SOCKS4 has no password, and was accepted anyway, so any client
could skip the check by speaking the older protocol. The UDP relay
answered datagrams from any address. And a username with no password
panicked on the right username, which a release build turns into an
abort.
With a username set, SOCKS4 is now refused, and the relay drops datagrams
from any IP address without an open, authenticated UDP ASSOCIATE
connection, as RFC 1928 asks; the association ends with that connection.
It is open before the reply goes out, since a client may send its first
datagram the moment it reads the reply. A username without a password
means an empty password, and a password without a username is a
configuration error instead of silently turning authentication off.
The UDP check is by IP address, since a client's sending port is not
known in advance; the docs say what that leaves open.
The audit asked for shutdown to be checked with two Go plugins loaded and
connections that close during the handshake or with a read or write
pending. plugin-cleanup/ does that over chain[go-tls, ws, go-trojan], and
over the Rust TLS plugin with leaf's own Trojan, so that a fault the host
shares can be told from one in the Go plugins.
The host now logs, at trace, each engine instance it creates and each one
whose destroy_instance has returned; the cases require the two to balance
and the node to shut down. The Go SDK's destroy waits for the
connection's goroutines, so one that never finished would show up here.
Both chains failed the handshake case before the previous commit: no
instance was destroyed while the server stayed silent.
docs/configuration.md lists every JSON option, environment variable and
command-line flag: what it does, what it accepts, and what happens when it
is left out, with the .conf keys mapped onto them. Options that decide
whether traffic stays behind the proxy are marked.
docs/security.md explains those choices together: names looked up outside
the proxy, where unmatched traffic goes, direct fallback, IPv6 under TUN,
certificate checks, logs, and how the protocols fare on filtered networks,
without presenting any as safe from a censor. It ends with a configuration
to start from, which has been run.
examples/README.md says what each example is for and what to change before
deploying one. The README links all three and no longer names the TUN
stacks that were replaced.