jlelse
/
ProxyExposer
Archived
1
Fork 0

Fix logging
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Jan-Lukas Else 2021-10-30 12:44:53 +02:00
parent 6dca5c5286
commit 4ab3108f30
1 changed files with 4 additions and 4 deletions

View File

@ -49,11 +49,11 @@ func main() {
rp.Transport = &http.Transport{
Proxy: http.ProxyURL(proxyUrl),
}
rp.Director = func(r *http.Request) {
log.Printf("%s %s %s\n", r.RemoteAddr, r.Method, r.URL.String())
}
err = http.ListenAndServe("0.0.0.0:"+strconv.Itoa(port), rp)
err = http.ListenAndServe("0.0.0.0:"+strconv.Itoa(port), http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
log.Printf("%s %s %s\n", r.RemoteAddr, r.Method, r.URL.String())
rp.ServeHTTP(rw, r)
}))
if err != nil {
log.Fatal(err.Error())
return