Created
February 14, 2024 05:44
-
-
Save cheikhsimsol/bac13e7b07be4457377863a5b5740637 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
target, _ := url.Parse("http://localhost:8081/base/") | |
// Create a reverse proxy | |
proxy := &httputil.ReverseProxy{ | |
Rewrite: func(r *httputil.ProxyRequest) { | |
log.Println("Forwarding:", r.In.URL.String()) | |
r.SetURL(target) | |
r.Out.Host = r.In.Host | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment