mirror of
https://gitee.com/konyshe/goodlink.git
synced 2025-09-26 12:41:14 +08:00
optimized heartbeat detection
This commit is contained in:
31
FyneApp.go
Normal file
31
FyneApp.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"log"
|
||||
|
||||
"github.com/BurntSushi/toml"
|
||||
)
|
||||
|
||||
//go:embed FyneApp.toml
|
||||
var FyneAppToml string
|
||||
|
||||
type FyneAppConfig struct {
|
||||
Website string `toml:"Website"`
|
||||
Details struct {
|
||||
Icon string `toml:"Icon"`
|
||||
Name string `toml:"Name"`
|
||||
ID string `toml:"ID"`
|
||||
Version string `toml:"Version"`
|
||||
Build int `toml:"Build"`
|
||||
} `toml:"Details"`
|
||||
}
|
||||
|
||||
func GetVersion() string {
|
||||
var config FyneAppConfig
|
||||
if _, err := toml.Decode(FyneAppToml, &config); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
return config.Details.Version
|
||||
}
|
@@ -4,5 +4,5 @@ Website = "https://goodlink.kony.vip"
|
||||
Icon = "assert/favicon.ico"
|
||||
Name = "goodlink-windows-amd64-ui"
|
||||
ID = "goodlink.kony.vip"
|
||||
Version = "2.1.2"
|
||||
Version = "2.1.3"
|
||||
Build = 0
|
||||
|
6
Makefile
6
Makefile
@@ -12,7 +12,6 @@ GOBUILD=GO111MODULE=on \
|
||||
-w -s -buildid='
|
||||
|
||||
PLATFORM_LIST = \
|
||||
windows-arm64-cmd \
|
||||
linux-386-cmd \
|
||||
linux-amd64-cmd \
|
||||
linux-arm-cmd \
|
||||
@@ -23,12 +22,15 @@ PLATFORM_LIST = \
|
||||
linux-mipsle-cmd \
|
||||
linux-mips64-cmd \
|
||||
linux-riscv64-cmd \
|
||||
linux-mips64le-cmd
|
||||
linux-mips64le-cmd \
|
||||
windows-arm64-cmd
|
||||
|
||||
NAC_PLATFORM_LIST = \
|
||||
windows-amd64-ui \
|
||||
windows-amd64-cmd \
|
||||
|
||||
debug: create_nac windows-amd64-ui rm_nac linux-amd64-cmd strip
|
||||
|
||||
all: create_nac $(NAC_PLATFORM_LIST) rm_nac $(PLATFORM_LIST) strip
|
||||
|
||||
linux-386-cmd:
|
||||
|
@@ -25,7 +25,7 @@ var (
|
||||
Arg_conn_passive_send_time int
|
||||
)
|
||||
|
||||
func Help() {
|
||||
func Help(ver string) {
|
||||
v := flag.Bool("v", false, "查看版本信息")
|
||||
|
||||
Arg_stun_test = flag.Bool("stun_test", false, "检测STUN列表是否可用")
|
||||
@@ -53,6 +53,7 @@ func Help() {
|
||||
flag.Parse()
|
||||
|
||||
if *v {
|
||||
fmt.Printf("Version: %s\n", ver)
|
||||
fmt.Print(gogo.BuildVersion())
|
||||
os.Exit(0)
|
||||
}
|
||||
|
@@ -62,7 +62,9 @@ func main() {
|
||||
}
|
||||
}()
|
||||
|
||||
config.Help()
|
||||
pro.SetVersion(GetVersion())
|
||||
|
||||
config.Help(GetVersion())
|
||||
|
||||
if *config.Arg_stun_test { // 测试stun节点,开发使用选项
|
||||
stun2.TestStun()
|
||||
|
@@ -22,11 +22,13 @@ const (
|
||||
)
|
||||
|
||||
func main() {
|
||||
config.Help()
|
||||
pro.SetVersion(GetVersion())
|
||||
|
||||
config.Help(GetVersion())
|
||||
|
||||
myApp := app.New()
|
||||
myApp.Settings().SetTheme(&theme.MyTheme{})
|
||||
myWindow := myApp.NewWindow(M_APP_TITLE + " v" + pro.GetVersion()) //myApp.Metadata().Version)
|
||||
myWindow := myApp.NewWindow(M_APP_TITLE + " v" + GetVersion()) //myApp.Metadata().Version)
|
||||
|
||||
if desk, ok := myApp.(desktop.App); ok {
|
||||
m := fyne.NewMenu(M_APP_TITLE,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
make clean
|
||||
make
|
||||
make all
|
||||
cd bin
|
||||
zip goodlink-linux-amd64-cmd.zip goodlink-linux-amd64-cmd
|
||||
zip goodlink-linux-arm64-cmd.zip goodlink-linux-arm64-cmd
|
||||
|
@@ -21,10 +21,15 @@ var (
|
||||
m_redis_db *redis.Client
|
||||
m_tun_key string
|
||||
m_md5_tun_key string
|
||||
m_version string
|
||||
)
|
||||
|
||||
func SetVersion(v string) {
|
||||
m_version = v
|
||||
}
|
||||
|
||||
func GetVersion() string {
|
||||
return "2.1.2"
|
||||
return m_version
|
||||
}
|
||||
|
||||
func Init() error {
|
||||
|
@@ -219,7 +219,7 @@ func RunRemote(tun_key string) error {
|
||||
|
||||
for m_remote_stats == 1 {
|
||||
|
||||
udp_conn, tun_active, tun_passive, quic_conn, health := GetRemoteQuicConn()
|
||||
udp_conn, tun_active, tun_passive, quic_conn, _ := GetRemoteQuicConn()
|
||||
if quic_conn == nil {
|
||||
Release(tun_active, tun_passive)
|
||||
continue
|
||||
@@ -244,13 +244,7 @@ func RunRemote(tun_key string) error {
|
||||
wg.Done()
|
||||
}()
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
proxy.ProcessProxyServer(quic_conn2)
|
||||
}()
|
||||
|
||||
tun.ProcessHealth(health)
|
||||
proxy.ProcessProxyServer(quic_conn2)
|
||||
utils.Log().DebugF("释放连接: %v", quic_conn2.LocalAddr())
|
||||
}(tun_active, tun_passive, quic_conn)
|
||||
}
|
||||
|
Reference in New Issue
Block a user