Skip to content

Commit

Permalink
just trace requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivo Bellin Salarin authored and Ivo Bellin Salarin committed Jun 2, 2016
1 parent ba35961 commit a47e639
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gssapi-proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ func getHTTPClient() http.Client {
return client
}


// TraceRequests empty comment
func TraceRequests(r *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) {
ctx.Logf("requesting %s, %s", r.Host, r.URL)
return r, nil
}

var opts Arguments

func main() {
Expand All @@ -118,6 +125,7 @@ func main() {

proxy := goproxy.NewProxyHttpServer()

proxy.OnRequest().DoFunc(TraceRequests)
/*
hijack connect: intercept the request, add the Proxy-Authorization header then send it to the remote host
proxy.OnRequest().HijackConnect(func(req *http.Request, client net.Conn, ctx *goproxy.ProxyCtx) {
Expand Down

0 comments on commit a47e639

Please sign in to comment.