ReverseProxy is an HTTP Handler that takes an incoming request and sends it to another server, proxying the response back to the client.
| 29 | // sends it to another server, proxying the response back to the |
| 30 | // client. |
| 31 | type ReverseProxy struct { |
| 32 | // Director must be a function which modifies |
| 33 | // the request into a new request to be sent |
| 34 | // using Transport. Its response is then copied |
| 35 | // back to the original client unmodified. |
| 36 | Director func(*http.Request) |
| 37 | |
| 38 | // The transport used to perform proxy requests. |
| 39 | // If nil, http.DefaultTransport is used. |
| 40 | Transport http.RoundTripper |
| 41 | |
| 42 | // FlushInterval specifies the flush interval |
| 43 | // to flush to the client while copying the |
| 44 | // response body. |
| 45 | // If zero, no periodic flushing is done. |
| 46 | FlushInterval time.Duration |
| 47 | |
| 48 | Inject inject.CopyInject |
| 49 | } |
| 50 | |
| 51 | func singleJoiningSlash(a, b string) string { |
| 52 | if b == "" { |
nothing calls this directly
no outgoing calls
no test coverage detected