On this page
timeout: no recent network activity: what it says
Hysteria2 and TUIC run on QUIC, which is UDP. The line comes from the QUIC library, quic-go, so it looks the same in Hysteria's own client, sing-box, mihomo and every app built on them. UDP has no refusal of a connection: a closed port, a firewall and a wrong obfs password all look like silence.
When it appears says which silence it is. While connecting, the library waits 5 seconds for any answer. On a connection that was working, it gives up after 30 seconds without a packet from the server (Hysteria's default idle timeout, with a keepalive every 10 seconds).
What you see, why, and what to do
failed to initialize clientwithconnect error: timeout: no recent network activity, on every networkCauseThe server isn't running, its UDP port is closed, the address or port is wrong, or obfs doesn't match
What to doThe server commands below; compare obfs on both sides
The same, but only on one network (office, hotel, one mobile operator)
CauseThis network drops UDP or recognises QUIC
What to doAnother port, port hopping, obfs, or a protocol over TCP
timeout: handshake did not complete in timeCauseSome packets did come back, but the handshake didn't finish in 10 seconds: heavy loss, or large packets don't get through
What to doAnother network or port; check that the VPN isn't running inside another VPN
connection closed: timeout: no recent network activityafter it workedCauseNothing from the server for 30 seconds: the network changed, the device slept, or a long UDP flow is throttled
What to doReconnect; port hopping; lower the bandwidth set in the client
authentication error, HTTP status code: 404(Hysteria) orauthentication failed, status code: 404(sing-box)CauseUDP works, the server refused the password
What to doCheck the password; with userpass it is written as
user:passwordCRYPTO_ERROR 0x12a (local): tls: failed to verify certificate: x509: certificate signed by unknown authorityCauseThe server's certificate is self-signed
What to doPin it with
pinSHA256, add its CA, or get a real certificatex509: certificate has expired or is not yet validCauseThe certificate ran out, or the device's clock is wrong
What to doTurn on automatic time; renew the certificate
CRYPTO_ERROR 0x178 (remote): tls: no application protocolCauseSomething answers QUIC on this port, but not your protocol: the ALPN differs
What to doCheck the port; for TUIC compare
alpnwith the server
Find the side that is silent
- 1
Change the network
Connect from a phone's hotspot or from mobile data with the same link. Works there: your network is the cause. Fails everywhere: the server or the link.
- 2
See whether QUIC passes at all
With the VPN off, open
https://www.cloudflare.com/cdn-cgi/tracein Chrome or Firefox and reload it once or twice.http=http/3means UDP 443 isn't closed outright.http/2every time hints that it is. - 3
Compare the link with the server
The address, the port,
obfsandobfs-password. A domain in the link should resolve to this server:nslookup vpn.example.com. If it also has an IPv6 address the server doesn't listen on, put the IPv4 address in the link. - 4
Open UDP, not just TCP
The server's own firewall and the hosting provider's panel are two separate lists. A rule for port 443 made for a website is usually TCP only.
Check on the server
Run these over SSH on the server. The service name is the one Hysteria's own install script creates; put your port in place of 443.
systemctl status hysteria-server.service
journalctl --no-pager -e -u hysteria-server.serviceThe first says whether the service is active, the second shows its last lines. A typo in the config or a busy port shows up here.
sudo ss -ulnp | grep 443-u is UDP: a line with your port and the program's name should be there. ss -tlnp shows TCP and tells you nothing about Hysteria2.
sudo tcpdump -ni any udp port 443Connect from the client while it runs. No packets: they are lost before the server, in your network or in the provider's firewall. Packets come in and none go out: the server drops them, most often because of obfs. Both directions: the answers are lost on the way back.
sudo ufw status
sudo ufw allow 443/udpFor a server with ufw. The provider's panel has its own firewall, and it needs the same UDP rule.
obfs and port hopping: the same on both sides
obfs scrambles every packet, so a server with obfs doesn't see a handshake in a packet without it, and the other way round. It doesn't answer either: Hysteria's documentation says that a wrong obfs password gives a timeout, just as if the server weren't running. The password must be at least 4 bytes long.
Port hopping helps when the network throttles one long UDP flow or blocks one port. The client picks a port from a range and moves to another every 30 seconds. On Linux the server can listen on a range by itself (listen: :20000-50000); older versions need a firewall rule that redirects the range to the server's port. The whole range has to be open for UDP. If the network blocks UDP as a whole, hopping won't help.
Hysteria
config.yamlobfs
obfs: type: salamander,passwordundersalamander:Port range
server: example.com:443,20000-50000,hopIntervalintransportA
hysteria2://linkobfs
obfs=salamander&obfs-password=…Port range
@example.com:443,20000-50000/ormport=20000-50000sing-box JSON
obfs
obfs:typeandpasswordPort range
server_ports,hop_intervalmihomo YAML
obfs
obfs,obfs-passwordPort range
ports,hop-interval
It connects, then drops every few minutes
- Bandwidth set too high. With
upanddownin the config, Hysteria2 sends at that speed whatever the network says. More than your line carries means loss, then a timeout. Set what the line really gives, or remove both lines: the client then uses BBR. - A throttled flow. If the speed falls a few minutes in and the connection dies, turn on port hopping.
- The network changed. Moving from Wi-Fi to mobile data leaves the client sending into the old network for up to 30 seconds before it gives up.
- The phone saves battery. Keepalive goes out every 10 seconds only while the app is running. Remove battery limits for it.
If it still times out
- The provider filters UDP. Some hosts limit inbound UDP or put DDoS protection in front of it. tcpdump on the server shows nothing while the client sends: ask support.
- A very old kernel. Hysteria's documentation names CentOS 7 among the causes of this error. A current Linux doesn't have it.
- An Ed25519 certificate. Recent Hysteria clients copy Chrome's QUIC, and Chrome doesn't accept Ed25519: the handshake fails. Use an ECDSA or RSA certificate, as Let's Encrypt issues.
- The network simply doesn't carry UDP. Nothing on the server helps then. A protocol over TCP, such as VLESS with Reality, goes through the same network.