mirror of
https://github.com/whyvl/wireproxy.git
synced 2025-04-29 19:01:42 +02:00
fix project file structure
This commit is contained in:
parent
c193ae32fa
commit
4937223047
4 changed files with 997 additions and 6 deletions
32
cmd/wireproxy/main.go
Normal file
32
cmd/wireproxy/main.go
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue