Stop guessing why your curl request is timing out
Networking & Firewall (Ss/Netstat/Iptables/Nftables/Curl)
Stop guessing why your curl request is timing out
🧩 The Challenge
Dealing with a connection that works from your laptop but hangs on the server is enough to drive anyone up a wall. You end up staring at a blinking cursor for thirty seconds just to find out it failed, which is a total waste of time when you’re already in the weeds.
💡 The Fix
Use curl’s verbose and trace options to dump exactly what happens during the handshake. It cuts through the fog and shows you if you’re actually hitting the target or getting silently dropped by a firewall halfway across the network.
curl -v --trace-time --connect-timeout 5 https://your-service-url.com
⚙️ Why It Works
Adding that trace-time flag puts a timestamp on every line of the output, so you can spot the exact millisecond the connection stops responding. That timeout flag is also a lifesaver because it prevents your script from hanging indefinitely while you’re trying to debug.
🚀 Pro-Tip: Pipe it into sed or awk if you only care about the connection headers and want to strip out the messy request body.
Linux Tips & Tricks | © ngelinux.com | 11/8/2026
