Go-Reverse-Proxy/cmd/shell/main.go

25 lines
370 B
Go

package main
import (
"fmt"
"log"
"net/http"
"gittea.kittel.dev/marco/proxy/proxy"
)
var (
PORT = 8080
)
func main() {
targets := []string{
"http://localhost:8081",
"http://localhost:8082",
}
p := proxy.NewProxy(targets)
log.Println("Reverse proxy started on %d", PORT)
portStr := fmt.Sprintf(":%d", PORT)
log.Fatal(http.ListenAndServe(portStr, p))
}