initial commit

This commit is contained in:
Dylan Parker
2023-01-08 03:26:04 -06:00
commit cfa445db14
11 changed files with 300 additions and 0 deletions

29
cmd/http/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")
log.Fatal(c.ListenAndServe())
}