test prefix stripping

This commit is contained in:
Your Name 2020-07-08 13:37:37 -04:00
parent dca4b24894
commit 969a2462c5
1 changed files with 3 additions and 1 deletions

View File

@ -14,6 +14,7 @@ import (
type myConfig struct {
MyURL string
MySock string
Strip string
}
func main() {
@ -21,6 +22,7 @@ func main() {
flag.StringVar(&c.MyURL, "url", "", "URL to proxy to")
flag.StringVar(&c.MySock, "unix", "", "Unix socket to listen on")
flag.StringVar(&c.Strip, "strip", "", "Strip prefix from reqeusts")
flag.Parse()
@ -43,7 +45,7 @@ func main() {
WriteTimeout: 3 * time.Second,
IdleTimeout: 30 * time.Second,
ReadHeaderTimeout: 20 * time.Second,
Handler: frontendProxy,
Handler: http.StripPrefix(c.Strip, frontendProxy),
}
unixListener, err := net.Listen("unix", c.MySock)