log errors - error handling still bad

rename folder
This commit is contained in:
Dylan Parker
2023-01-08 05:13:24 -06:00
parent 5eff7e1c08
commit 37ca09669a
3 changed files with 2 additions and 1 deletions

29
cmd/server/main.go Normal file
View File

@@ -0,0 +1,29 @@
package main
import (
"log"
"os"
"github.com/dgparker/lilproxy/pkg/udpproxy"
)
func main() {
target := os.Getenv("LILPROXY_TARGET")
if target == "" {
log.Fatal("env LILPROXY_TARGET required")
}
port := os.Getenv("LILPROXY_PORT")
if port == "" {
log.Fatal("env LILPROXY_PORT required")
}
c, err := udpproxy.New(port, target)
if err != nil {
log.Fatal(err)
}
log.Printf("lilproxy initialized on port: (%s) target address: (%s)", port, target)
log.Fatal(c.ListenAndServe())
}