(req *http.Request)
| 179 | } |
| 180 | |
| 181 | func (p *Proxy) director(req *http.Request) { |
| 182 | u := p.backend(req) |
| 183 | if u == nil { |
| 184 | return |
| 185 | } |
| 186 | |
| 187 | // we don't use https explicitly, ssl termination is done here |
| 188 | req.URL.Scheme = "http" |
| 189 | req.URL.Host = u.Host |
| 190 | req.URL.Path = u.Path |
| 191 | } |
| 192 | |
| 193 | // ListenAndServe listens on the TCP network address addr and then calls Serve |
| 194 | // with handler to handle requests on incoming connections. |