mirror of
https://github.com/kataras/iris.git
synced 2026-01-07 20:17:05 +00:00
_examples: update modules
This commit is contained in:
@@ -31,7 +31,18 @@ func ProxyHandler(target *url.URL, config *tls.Config) *httputil.ReverseProxy {
|
||||
req.URL.Path = path.Join(target.Path, req.URL.Path)
|
||||
}
|
||||
|
||||
p := &httputil.ReverseProxy{Director: director}
|
||||
// TODO: when go 1.20 released:
|
||||
/*
|
||||
rewrite := func(r *httputil.ProxyRequest) {
|
||||
r.SetURL(target) // Forward request to outboundURL.
|
||||
r.SetXForwarded() // Set X-Forwarded-* headers.
|
||||
// r.Out.Header.Set("X-Additional-Header", "header set by the proxy")
|
||||
// To preserve the inbound request's Host header (the default behavior of NewSingleHostReverseProxy):
|
||||
// r.Out.Host = r.In.Host
|
||||
}
|
||||
*/
|
||||
|
||||
p := &httputil.ReverseProxy{Director: director /*, Rewrite: rewrite */}
|
||||
|
||||
if netutil.IsLoopbackHost(target.Host) {
|
||||
transport := &http.Transport{
|
||||
|
||||
Reference in New Issue
Block a user