Connection
Configure redirects, timeouts, proxies, retries, DNS resolution, and SSL verification.
Redirects
Follow Redirects
By default, tgrs does not follow redirects. Use -L / --follow to follow redirect chains. tgrs shows each hop along the way.
# Follow redirects
tgrs GET https://example.com/old-page -L
tgrs GET https://example.com/old-page --follow
# Limit max redirects (default: 10)
tgrs GET https://example.com/old-page -L --max-redirects 5
Timeouts
Request Timeouts
Control how long tgrs waits for a response.
# Total request timeout (seconds)
tgrs GET https://api.example.com/slow-endpoint -m 10
tgrs GET https://api.example.com/slow-endpoint --timeout 10
# Connection timeout only (seconds)
tgrs GET https://api.example.com/data --connect-timeout 5
# Both timeouts
tgrs GET https://api.example.com/data --connect-timeout 5 -m 30
Proxy
HTTP/HTTPS Proxy
Route requests through a proxy server with -x / --proxy.
# HTTP proxy
tgrs GET https://api.example.com/data -x http://proxy.example.com:8080
tgrs GET https://api.example.com/data --proxy http://proxy.example.com:8080
# Proxy with authentication
tgrs GET https://api.example.com/data -x http://user:pass@proxy.example.com:8080
Retry
Automatic Retry
Automatically retry failed requests with --retry and control the delay between retries.
# Retry up to 3 times
tgrs GET https://api.example.com/flaky-endpoint --retry 3
# Retry with custom delay (seconds, default: 1)
tgrs GET https://api.example.com/flaky-endpoint --retry 3 --retry-delay 2
Retries are triggered on connection errors, server errors (5xx), and rate limits (429).
DNS Resolution
Custom DNS Resolution
Override DNS resolution with --resolve to point a hostname to a specific IP address. Useful for testing local servers or staging environments.
# Resolve api.example.com to localhost
tgrs GET https://api.example.com/data --resolve api.example.com:443:127.0.0.1
# Point to a staging server
tgrs GET https://api.example.com/data --resolve api.example.com:443:10.0.1.50
SSL / TLS
Skip SSL Verification
Use -k / --insecure to skip SSL certificate verification. Useful for self-signed certificates in development.
# Skip SSL verification
tgrs GET https://localhost:8443/api/data -k
tgrs GET https://localhost:8443/api/data --insecure
-k in development environments. Skipping SSL verification in production disables important security checks.Response Size Limit
Maximum Response Size
Limit the maximum response body size with -S / --max-filesize.
# Limit to 1MB
tgrs GET https://api.example.com/large-response -S 1048576
tgrs GET https://api.example.com/large-response --max-filesize 1048576
Quick Reference
Connection Flags
| Flag | Alias | Description |
|---|---|---|
| -L | --follow | Follow redirects |
| --max-redirects | Max redirect hops (default: 10) | |
| -m | --timeout | Total request timeout (seconds) |
| --connect-timeout | Connection timeout (seconds) | |
| -x | --proxy | Proxy URL |
| --retry | Retry count (default: 0) | |
| --retry-delay | Delay between retries (seconds, default: 1) | |
| --resolve | DNS override (HOST:PORT:ADDR) | |
| -k | --insecure | Skip SSL verification |
| -S | --max-filesize | Max response body size (bytes) |