Skip to content

Commit

Permalink
Merge pull request #3 from shanghaobo/dev
Browse files Browse the repository at this point in the history
fix:启动frp有黑窗口
  • Loading branch information
shanghaobo authored Aug 24, 2023
2 parents 3e3a93d + aacb9ca commit fad8947
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions frp/frp.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package frp

import (
"embed"
"fmt"
"http-win-notice/utils"
"http-win-notice/utils/setting"
"log"
"os"
"os/exec"
"path"
"strconv"
"syscall"
)

//go:embed frpc.exe
Expand Down Expand Up @@ -65,11 +65,9 @@ func StartFrp() {
initFrpConfig()
frpExePath := path.Join(utils.RootDir, "frpc.exe")
configPath := path.Join(utils.RootDir, "frpc.ini")
fmt.Println("frp path=", frpExePath)
cmd := exec.Command(frpExePath, "-c", configPath)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run()
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
err := cmd.Start()
if err != nil {
log.Fatalln("frp启动失败", err)
}
Expand Down

0 comments on commit fad8947

Please sign in to comment.