fix project file structure

This commit is contained in:
octeep 2022-03-29 00:32:44 +01:00 committed by octeep
parent c193ae32fa
commit 4937223047
4 changed files with 997 additions and 6 deletions

32
cmd/wireproxy/main.go Normal file
View file

@ -0,0 +1,32 @@
package main
import (
"fmt"
"log"
"os"
"github.com/octeep/wireproxy"
)
func main() {
if len(os.Args) != 2 {
fmt.Println("Usage: wireproxy [config file path]")
return
}
conf, err := wireproxy.ParseConfig(os.Args[1])
if err != nil {
log.Panic(err)
}
tnet, err := wireproxy.StartWireguard(conf.Device)
if err != nil {
log.Panic(err)
}
for _, spawner := range conf.Routines {
go spawner.SpawnRoutine(tnet)
}
select {} // sleep eternally
}