1
0
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:
Gerasimos (Makis) Maropoulos
2022-12-26 23:26:47 +02:00
parent 3a7260391c
commit 196063d4db
59 changed files with 2581 additions and 2575 deletions

View File

@@ -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{