add print welcome

This commit is contained in:
xvzc 2022-01-04 01:46:16 +09:00
parent 5f93aaf92f
commit 117e053751
2 changed files with 28 additions and 8 deletions

View File

@ -2,11 +2,12 @@ package main
import (
"flag"
"log"
"os"
"github.com/pterm/pterm"
"github.com/xvzc/SpoofDPI/config"
"github.com/xvzc/SpoofDPI/proxy"
"github.com/xvzc/SpoofDPI/util"
)
func main() {
@ -21,14 +22,13 @@ func main() {
os.Exit(1)
}
cyan := pterm.NewLettersFromStringWithStyle("Spoof", pterm.NewStyle(pterm.FgCyan))
purple := pterm.NewLettersFromStringWithStyle("DPI", pterm.NewStyle(pterm.FgLightMagenta))
pterm.DefaultBigText.WithLetters(cyan, purple).Render()
util.PrintWelcome()
pterm.DefaultBulletList.WithItems([]pterm.BulletListItem{
{Level: 0, Text: "SRC : " + *src},
{Level: 0, Text: "DNS : " + *dns},
}).Render()
err = config.SetOsProxy()
if err != nil {
log.Fatal(err)
os.Exit(1)
}
proxy.Start()
}

20
util/welcome.go Normal file
View File

@ -0,0 +1,20 @@
package util
import (
"github.com/pterm/pterm"
"github.com/xvzc/SpoofDPI/config"
)
func PrintWelcome() {
cyan := pterm.NewLettersFromStringWithStyle("Spoof", pterm.NewStyle(pterm.FgCyan))
purple := pterm.NewLettersFromStringWithStyle("DPI", pterm.NewStyle(pterm.FgLightMagenta))
pterm.DefaultBigText.WithLetters(cyan, purple).Render()
pterm.DefaultBulletList.WithItems([]pterm.BulletListItem{
{Level: 0, Text: "SOURCE IP : " + config.GetConfig().SrcIp},
{Level: 0, Text: "SOURCE PORT : " + config.GetConfig().SrcPort},
{Level: 0, Text: "DNS : " + config.GetConfig().DNS},
}).Render()
}