I ran your code and it seems ok. [image: 1.PNG]
在 2018年9月18日星期二 UTC+8上午6:08:34,Nizar AYARI写道: > > I'm trying to create a reverse proxy that takes all requests and redirect > them into a target url, like google.com or any other API. Unfortunately, > all targets returns errors like page Not Found, or Forbidden Error. > > > Please see the source code here: > > > > https://stackoverflow.com/questions/52374659/golang-reverse-proxy-returns-not-found-or-forbidden-errors > > > I spent many days trying to set appropriate headers but nothing worked so > far. I think the headers were not set correctly but I don't how to copy > headers from client and add it to the proxy. > > I'm using a proxy instead of a redirect because I have to do some work > with the body request and response! > > Thanks in advance! > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.