Skip to content

j0hnsmith/connspy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

connspy

Tools for spying on connections, all output read/written to stderr

http package

A http.Client suitable for debugging, writes all http data to stdout.

client := connspy.NewClient(nil, nil)

resp, _ := client.Get("http://example.com/")
// ensure all of the body is read
ioutil.ReadAll(resp.Body)
resp.Body.Close()

resp, _ = client.Get("https://example.com/")
ioutil.ReadAll(resp.Body)
resp.Body.Close()

http output to stderr

net package

Provides a net.Conn wrapper that writes all reads/writes to stderr.

Docs

GoDoc

Background info

https://medium.com/@j0hnsmith/eavesdrop-on-a-golang-http-client-c4dc49af9d5e