Skip to content

Instantly share code, notes, and snippets.

@LautaroJayat
Created May 10, 2021 13:38
Show Gist options
  • Save LautaroJayat/1446bdd97b91016f942226b694c54942 to your computer and use it in GitHub Desktop.
Save LautaroJayat/1446bdd97b91016f942226b694c54942 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"net/http"
"net/http/httputil"
"os"
d "github.com/lautarojayat/auth_proxy/proxy/director"
rt "github.com/lautarojayat/auth_proxy/proxy/router"
)
var rp = httputil.ReverseProxy{
Director: d.NewDirector(),
}
func main(){
fmt.Printf("SCHEME %v\n", os.Getenv("SCHEME"))
fmt.Printf("HOST %v\n", os.Getenv("HOST"))
fmt.Printf("Auth %v\n", os.Getenv("AUTH"))
fmt.Println("Starting proxy server")
r := rt.NewRouter(&rp)
srv := http.Server{
Handler: r,
Addr: "localhost:8081",
}
srv.ListenAndServe()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment