Clone `t.tlsConfig` per dial and invoke `t.echConfig.ClientHandle` when
`ech-opts` is enabled so TUIC QUIC handshakes populate
`EncryptedClientHelloConfigList` without racing on shared `*tls.Config`
state across concurrent dials.
In Dispatcher.TCPSniff, any error returned by sniffDomain incremented
skipList[dstIP:port], including connections that closed or were canceled
before sending a single application byte (such as speculative browser
pre-connects or Happy Eyeballs races). Six such zero-byte closures
disabled SNI sniffing for all domains sharing that IP:port for the full
600 s TTL.
Skip caching the failure when conn.Buffered() == 0 and the error is a
connection-closed or cancellation error (io.EOF, io.ErrUnexpectedEOF,
net.ErrClosed, syscall.ECONNRESET, context.Canceled, etc.), while still
counting server-first read timeouts (os.ErrDeadlineExceeded) and
unrecognized or truncated payloads.
Fixes#3527
A lookup that starts while the old network is going away (for example
Wi-Fi dropping on Android) can be sent to servers that will never
answer. It runs on its own DefaultDNSTimeout inside the singleflight
group, and every later request for the same name joins it, even after
the platform has signalled the network change (Clash Meta for Android
calls ClearCache and ResetConnection on every DNS change). So all
requests for that name fail together when the stale lookup times out.
Reset the singleflight group both before and after resetting the
clients. Before, so requests made while a client reset is blocked
(DoH's ResetConnection waits for clientMu) start a fresh lookup instead
of joining one stuck on the old network. After, so requests made once
ResetConnection returns do not join a lookup that started during the
reset on a connection from before the change.
ChromeVersion() had no lower bound. A clock before ~2012 gave a negative
version, and the GREASE helpers indexed with a negative modulo during
package init, crashing the core even for `mihomo -v`. Clamp the version
to startVersion.
ParseProxy built the outbound and then returned early if the smux options
failed to decode or NewSingMux failed, without closing it. Outbounds that
acquire process-wide state in their constructor kept it: EasyTier and
Tailscale register a DNS client by name and only remove it in Close, so a
failed parse left a client behind that a later outbound of the same name
would replace and then delete.
Close the outbound on both error paths and keep the wrapped value in a
separate variable so a failed NewSingMux cannot shadow the proxy that needs
closing.
dns.msftnsci.com / www.msftnsci.com are transposed; NCSI probes dns.msftncsi.com and www.msftncsi.com. Under fake-ip, the unfiltered real probe host resolves to 198.18.x.x and Windows 10 reports "no internet".
When a real IP is returned from fake-ip-filter, subsequent connection
toward the real IP will be mapped back to domain (redir-host behavior).
For configurations with a small number of filtered real IP, the real IP
returned is functionally equivalent to a fake IP.
Add a configuration option to disable the redir-host behavior in fake
IP mode.
The v2 server authenticates the client only if its HMAC covers all the
data relayed from the handshake server, or all but the last write. The
client hashed only the bytes the TLS stack asked for, which end at the
server Finished record, so session tickets sent in the same flight were
left out whenever the stack's last read did not happen to pick them up.
With an X25519MLKEM768 ServerHello this happened on every connection to
a Go crypto/tls handshake server, and the chrome fingerprint always fell
back. Read the socket through a 16 KiB buffer and hash everything each
read returns, as the original implementation does.
A proxy-provider without its own age-secret-key passes "" to
age.DecryptBytes, which failed with "no identities found" before the
global secret keys were tried.
Add `users` (username: password) to the shadowsocks listener so that
multiple users can share one port. The matched username is set as
InUser, so IN-USER rules work for both TCP and UDP.
- 2022-blake3-aes-*: `password` is the server PSK and each user password
is the user PSK, clients use "iPSK:uPSK".
- legacy AEAD: user passwords are used directly, `password` must be empty.
- other methods return an error when `users` is set.
Consume raw host/TUN packet egress for each running instance so the bounded EasyTier packet sink cannot backpressure the data plane. Stop receiving when the instance closes or the adapter is canceled, and document packet ownership.
Mainly fixes an issue of infinite TCP read retry when using QUIC like Hy2
as mieru's dialer proxy. The issue was reported by a user of mihomo 1.19.32.
Also includes other improvements.