diff --git a/main.go b/main.go index 0e69449..6bb6221 100644 --- a/main.go +++ b/main.go @@ -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)