![]() |
|
How to Use curl Follow Redirect Verbose for Debugging? or Why Isn't curl Follow Redirect Verbose Show - Printable Version +- Proxy Community (https://proxycommunity.com/forum) +-- Forum: Technical Community Support (https://proxycommunity.com/forum/forum-technical-community-support) +--- Forum: API and Development (https://proxycommunity.com/forum/forum-api-and-development) +--- Thread: How to Use curl Follow Redirect Verbose for Debugging? or Why Isn't curl Follow Redirect Verbose Show (/thread-how-to-use-curl-follow-redirect-verbose-for-debugging-or-why-isn-t-curl-follow-redirect-verbose-show) Pages:
1
2
|
How to Use curl Follow Redirect Verbose for Debugging? or Why Isn't curl Follow Redirect Verbose Show - VeilStorm99 - 20-08-2024 "curl follow redirect verbose not showing all steps – what's up?" Hey folks! So I'm trying to debug some redirects with `curl follow redirect verbose`, but it's not showing *all* the hops. Like, it just skips some? I'm using: ```bash curl -v -L http://example.com ``` Shouldn't `-L` (follow redirect) + `-v` (verbose) show *every* redirect? Am I missing something obvious? Also, is there a better way to track *exactly* where the request goes? Sometimes the output's a mess and hard to follow. Thanks in advance! 🙏 (ps. yes, i checked man pages, still confused lol) “” - ZeroTraceX - 31-12-2024 Hey! Yeah, curl follow redirect verbose can be a bit sneaky sometimes. The `-v` flag shows headers, but if you want *every* redirect step, try adding `--max-redirs 20` (or some high number) to make sure it doesn't bail early. Also, `curl -v -L -w "%{url_effective}\n" http://example.com` might help—it prints the final URL after all hops. For cleaner output, tools like `httpie` or even browser dev tools (Network tab) might be easier to follow. “” - securePhantom99 - 11-02-2025 Ugh, redirects are the worst. curl follow redirect verbose *should* show all steps, but sometimes intermediate hops get hidden if they’re super fast or cached. Try `--proxy ""` to bypass any system proxy weirdness. Also, `strace -e trace=network curl -vL http://example.com` can show low-level network calls if you're *really* desperate. Might be overkill, but hey, debugging is pain. “” - dataStorm77 - 07-03-2025 Pro tip: Use `curl -v -L --raw http://example.com` to avoid HTTP/2 compression messing with headers. Sometimes that hides redirect details. If you’re on Linux, `tcpdump` or Wireshark can capture *everything*, but that’s nuclear option lol. Also, check if the server’s sending `HSTS`—curl might skip steps if it’s forcing HTTPS silently. “” - stealthLinkX - 08-03-2025 curl follow redirect verbose not showing all steps? Classic. Try `-D -` to dump headers to stdout, like: ```bash curl -vL -D - http://example.com | grep -i "^Location:" ``` This’ll force you to see *every* Location header, even if curl’s being lazy. Alternatively, `mitmproxy` is god-tier for tracing redirect chains visually. “” - secureShifterX - 08-03-2025 Wait, are you sure the missing hops aren’t just relative redirects? curl follow redirect verbose *does* follow them, but the output might not highlight the full URL. Try `--location-trusted` if the redirects involve auth or cookies. Also, `-i` includes response headers, which sometimes helps. If all else fails, `curl --trace-ascii debug.log -L http://example.com` dumps *everything* to a file. “” - SecretPass99 - 16-03-2025 Dude, same issue here. curl follow redirect verbose is kinda hit or miss with 30X responses. One hack: Chain `curl -v http://example.com`, then manually follow each `Location` header with a new curl. Tedious, but works. Or just use Python `requests` with `allow_redirects=True` and print the `history`—way cleaner for debugging. “” - ghostTorX77 - 19-03-2025 Yo! curl follow redirect verbose *usually* works, but some servers do shady stuff like meta-refresh or JS redirects (which curl ignores). For a bulletproof trace, try `curl -vL --trace-time http://example.com`. The timestamps help untangle the mess. Or, if you’re fancy, `burp suite` intercepts and maps every hop like a boss. “” - VeilStorm99 - 19-03-2025 OP here—thanks y’all! Tried `--max-redirs 20` and `-w "%{url_effective}"`, and it’s *way* clearer now. Still weird that curl follow redirect verbose hides some hops by default, but the `--trace-ascii` tip was golden. Follow-up Q: Anyone know why curl doesn’t show *all* intermediate URLs by default? Like, is there a legit reason or just legacy code? 🤔 “” - HyperNomad99 - 21-03-2025 Fun fact: curl follow redirect verbose might skip hops if they’re circular (like A → B → A). It caps at 50 by default (`--max-redirs`). For clarity, try `-sSLv` (silent but show errors + verbose). Or, if you’re lazy, `curl -vL 2>&1 | grep -E "(Location:|HTTP/)"` filters the noise. `websniffer.cc` is also a neat online tool for visualizing redirects. |