Project: HTTP Debug CLI
Project: HTTP Debug CLI
Overview
httpdbg: curl-like teaching client with timing breakdowns.
Features
httpdbg get URL
httpdbg get -H "Accept: application/json" -v URL
httpdbg timings URL # DNS / connect / TLS / TTFB sketchTimings sketch
Use http.Transport + httptrace.ClientTrace:
trace := &httptrace.ClientTrace{
DNSDone: func(info httptrace.DNSDoneInfo) { /* mark */ },
ConnectDone: func(network, addr string, err error) {},
GotFirstResponseByte: func() {},
}
req = req.WithContext(httptrace.WithClientTrace(ctx, trace))Requirements
- Timeouts
-owrite body to file
- Print status and selected headers on
-v
- Never follow redirects beyond
-max-redir
Acceptance
go run . get -v https://example.com
go run . timings https://example.com