This tool is primarily designed to work with HTTP/3 MASQUE proxies. It supports various HTTP methods, customizable headers, request payloads, and automatic redirect following.
To use the H3 script, ensure that you have Python 3.x installed on your system.
pip install git+https://github.com/luminati-io/h3-cli.git- Basic GET request:
h3 https://example.com- POST request with custom headers:
h3 POST https://example.com -H "User-Agent: CustomAgent" -H "Authorization: Bearer <token>" -d "name=John&age=30"- GET request with proxy:
h3 https://example.com --proxy brd.superproxy.io:10001 --proxy-auth brd-customer-hl_xxx-zone-yyy:password- Follow redirects (
-L):
h3 -L https://example.com/redirect-meBy default, 3xx responses are returned as-is. Pass -L to follow redirects automatically (up to 10 hops):
- 301, 302, 303 — method is downgraded to GET and the request body is dropped.
- 307, 308 — method and body are preserved.
python3 tests/test_send_request.py
python3 tests/test_follow_redirects.pypython3 -m pytest tests/ -v
### Test coverage
| File | What it covers |
|---|---|
| `tests/test_send_request.py` | Basic GET/POST/HEAD, body output, `show_headers`, `ProxyBadStatus`, `Http3ClientError`, unexpected exception re-raise, `validate_https_url`, `validate_headers`, full `main()` arg-parsing flow |
| `tests/test_follow_redirects.py` | `-L` flag disabled by default, single 301/302/307 follow, relative/absolute-path/full-URL location resolution, POST→GET method downgrade on 301/302, POST preserved on 307, redirect loop guard (`MAX_REDIRECTS`) |
## License
ISC — see [LICENSE](LICENSE).