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