Skip to content

Instantly share code, notes, and snippets.

@steventen
Created November 21, 2014 19:18
Show Gist options
  • Save steventen/e9a4fb3380e4ca4002e8 to your computer and use it in GitHub Desktop.
Save steventen/e9a4fb3380e4ca4002e8 to your computer and use it in GitHub Desktop.
Get request info
proxy.OnRequest().DoFunc(func(req *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) {
logger.Printf("Request: %s | IP: %s", req.URL, req.RemoteAddr)
return req, nil
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment