2021-12-28 02:28:43 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2021-12-29 17:08:30 +00:00
|
|
|
"flag"
|
2022-01-03 16:46:16 +00:00
|
|
|
"log"
|
2021-12-29 17:08:30 +00:00
|
|
|
"os"
|
2021-12-28 06:10:06 +00:00
|
|
|
|
2022-01-03 07:24:39 +00:00
|
|
|
"github.com/xvzc/SpoofDPI/config"
|
2022-01-03 15:13:42 +00:00
|
|
|
"github.com/xvzc/SpoofDPI/proxy"
|
2022-01-03 16:46:16 +00:00
|
|
|
"github.com/xvzc/SpoofDPI/util"
|
2021-12-28 02:28:43 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2022-01-03 15:13:42 +00:00
|
|
|
src := flag.String("src", "127.0.0.1:8080", "source-ip:source-port")
|
2021-12-29 17:08:30 +00:00
|
|
|
dns := flag.String("dns", "8.8.8.8", "DNS server")
|
|
|
|
debug := flag.Bool("debug", false, "true | false")
|
2022-01-03 15:30:15 +00:00
|
|
|
|
2022-01-03 15:13:42 +00:00
|
|
|
flag.Parse()
|
2021-12-29 17:08:30 +00:00
|
|
|
|
2022-01-03 15:13:42 +00:00
|
|
|
err := config.InitConfig(*src, *dns, *debug)
|
2021-12-29 17:08:30 +00:00
|
|
|
if err != nil {
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
|
2022-01-03 16:46:16 +00:00
|
|
|
util.PrintWelcome()
|
2022-01-03 15:13:42 +00:00
|
|
|
|
2022-01-03 16:46:16 +00:00
|
|
|
err = config.SetOsProxy()
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
2022-01-03 15:13:42 +00:00
|
|
|
|
2021-12-29 17:08:30 +00:00
|
|
|
proxy.Start()
|
2021-12-28 02:28:43 +00:00
|
|
|
}
|