From 4b45ea0ac72239e1b0b2c7a1be7dc7eae8ce9a00 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 14 Nov 2010 14:02:43 -0500 Subject: [PATCH] Add logging for proxy errors. --- src/server.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server.go b/src/server.go index 07674a0..f6fb034 100644 --- a/src/server.go +++ b/src/server.go @@ -107,6 +107,7 @@ func proxyHandler(response http.ResponseWriter, request *http.Request) { func performProxy(url *http.URL, response http.ResponseWriter, origRequest *http.Request) os.Error { conn, err := net.Dial("tcp", "", url.Host + ":http") if err != nil { + fmt.Printf("Could not dial: %v\n", err) return err } client := http.NewClientConn(conn, nil) @@ -116,11 +117,13 @@ func performProxy(url *http.URL, response http.ResponseWriter, origRequest *http request.UserAgent = origRequest.UserAgent err = client.Write(&request) if err != nil { + fmt.Printf("Could not proxy: %v\n", err) return err } var proxyResponse *http.Response proxyResponse, err = client.Read() if err != nil && err != http.ErrPersistEOF { + fmt.Printf("Could not read proxied response: %v\n", err) return err } _, err = io.Copy(response, proxyResponse.Body) -- 2.43.5