I am trying to play with golang's reverse proxy. I am trying to create a reverse proxy on my localhost that would forward my request to google.com and get back with the response. Even though this seems a simple task, I am not able to get a correct result. I am getting a google 404 response saying that the url "/" is not found
My code
package main
import (
"log"
"net/http"
"net/http/httputil"
"net/url"
)
func main() {
gogle, _ := url.Parse("http://www.google.com")
proxy := httputil.NewSingleHostReverseProxy(gogle)
log.Fatal(http.ListenAndServe(":12345", proxy))
}
what is that I am missing?