diff --git a/core/.gitignore b/core/.gitignore index 96af7a5..5410034 100644 --- a/core/.gitignore +++ b/core/.gitignore @@ -3,6 +3,4 @@ *.json *.exe *.dat -/cmd/nekoray_core/nekoray_core -/cmd/nekobox_core/nekobox_core *.db diff --git a/core/server/internal/boxapi/go_net.go b/core/server/internal/boxapi/go_net.go deleted file mode 100644 index e0aa1b5..0000000 --- a/core/server/internal/boxapi/go_net.go +++ /dev/null @@ -1,17 +0,0 @@ -package boxapi - -import ( - "context" - "github.com/sagernet/sing-box/common/dialer" - "github.com/sagernet/sing/common/metadata" - "nekobox_core/internal/boxbox" - "net" -) - -func DialContext(ctx context.Context, box *boxbox.Box, network, addr string) (net.Conn, error) { - conn, err := dialer.NewDefaultOutbound(box.Outbound()).DialContext(ctx, network, metadata.ParseSocksaddr(addr)) - if err != nil { - return nil, err - } - return conn, nil -} diff --git a/core/server/internal/boxdns/dns_manager_windows.go b/core/server/internal/boxdns/dns_manager_windows.go index ba84aa3..07f458d 100644 --- a/core/server/internal/boxdns/dns_manager_windows.go +++ b/core/server/internal/boxdns/dns_manager_windows.go @@ -25,7 +25,7 @@ var dnsIsSet bool func (d *DnsManager) HandleSystemDNS(ifc *control.Interface, flag int) { if d == nil { - log.Println("No DnsManager, you may need to restart nekoray") + log.Println("No DnsManager, you may need to restart Throne") return } if ifc != nil { @@ -42,7 +42,7 @@ func (d *DnsManager) HandleSystemDNS(ifc *control.Interface, flag int) { func (d *DnsManager) getInterfaceGuid(ifc control.Interface) (string, error) { if d.Monitor == nil { - return "", E.New("No Dns Manager, you may need to restart nekoray") + return "", E.New("No Dns Manager, you may need to restart Throne") } index := ifc.Index u, err := ifcIdxtoUUID(index) @@ -83,8 +83,8 @@ func ifcIdxtoUUID(index int) (*uuid.UUID, error) { func (d *DnsManager) isIfcDNSDhcp(ifc control.Interface) (dhcp bool, err error) { if d == nil { - log.Println("No DnsManager, you may need to restart nekoray") - return false, E.New("No Dns Manager, you may need to restart nekoray") + log.Println("No DnsManager, you may need to restart Throne") + return false, E.New("No Dns Manager, you may need to restart Throne") } luid, err := winipcfg.LUIDFromIndex(uint32(ifc.Index)) @@ -226,8 +226,8 @@ func (d *DnsManager) setSystemDNS(ifx control.Interface) { func (d *DnsManager) SetSystemDNS(ifc *control.Interface, clear bool) error { if d == nil { - log.Println("No DnsManager, you may need to restart nekoray") - return E.New("No dns Manager, you may need to restart nekoray") + log.Println("No DnsManager, you may need to restart Throne") + return E.New("No dns Manager, you may need to restart Throne") } if ifc == nil { diff --git a/core/server/internal/boxdns/monitor_windows.go b/core/server/internal/boxdns/monitor_windows.go index 86fe45e..76b9855 100644 --- a/core/server/internal/boxdns/monitor_windows.go +++ b/core/server/internal/boxdns/monitor_windows.go @@ -45,7 +45,7 @@ type DnsManager struct { func (d *DnsManager) HandleUnderlyingDNS(ifc *control.Interface, flag int) { if d == nil { - log.Println("No DnsManager, you may need to restart nekoray") + log.Println("No DnsManager, you may need to restart Throne") return } if ifc == nil { diff --git a/core/updater/main.go b/core/updater/main.go index e5fc5b7..536d189 100644 --- a/core/updater/main.go +++ b/core/updater/main.go @@ -30,9 +30,9 @@ func main() { time.Sleep(time.Second) Updater() // 3. start - exec.Command("./nekoray.exe").Start() + exec.Command("./Throne.exe").Start() } else { - // 1. nekoray stop itself and run "updater.exe" + // 1. Throne stop itself and run "updater.exe" Copy("./updater.exe", "./updater.old") exec.Command("./updater.old", os.Args[1:]...).Start() } @@ -40,7 +40,7 @@ func main() { // 1. update files Updater() // 2. start - exec.Command("./nekoray").Start() + exec.Command("./Throne").Start() } return } diff --git a/core/updater/updater.go b/core/updater/updater.go index 6b2a2ec..df960a3 100644 --- a/core/updater/updater.go +++ b/core/updater/updater.go @@ -16,17 +16,17 @@ func Updater() { if runtime.GOOS == "linux" { os.RemoveAll("./usr") } - os.RemoveAll("./nekoray_update") + os.RemoveAll("./Throne_update") } // find update package var updatePackagePath string if len(os.Args) == 2 && Exist(os.Args[1]) { updatePackagePath = os.Args[1] - } else if Exist("./nekoray.zip") { - updatePackagePath = "./nekoray.zip" - } else if Exist("./nekoray.tar.gz") { - updatePackagePath = "./nekoray.tar.gz" + } else if Exist("./Throne.zip") { + updatePackagePath = "./Throne.zip" + } else if Exist("./Throne.tar.gz") { + updatePackagePath = "./Throne.tar.gz" } else { log.Fatalln("no update") } @@ -43,7 +43,7 @@ func Updater() { if err != nil { log.Fatalln(err.Error()) } - err = extract.Zip(context.Background(), f, dir+string(os.PathSeparator)+"nekoray_update", nil) + err = extract.Zip(context.Background(), f, dir+string(os.PathSeparator)+"Throne_update", nil) if err != nil { log.Fatalln(err.Error()) } @@ -54,7 +54,7 @@ func Updater() { if err != nil { log.Fatalln(err.Error()) } - err = extract.Gz(context.Background(), f, dir+string(os.PathSeparator)+"nekoray_update", nil) + err = extract.Gz(context.Background(), f, dir+string(os.PathSeparator)+"Throne_update", nil) if err != nil { log.Fatalln(err.Error()) } @@ -66,15 +66,15 @@ func Updater() { removeAll("./*.dmp") // update move - err = Mv("./nekoray_update/nekoray", "./") + err = Mv("./Throne_update/Throne", "./") if err != nil { - MessageBoxPlain("NekoGui Updater", "Update failed. Please close the running instance and run the updater again.\n\n"+err.Error()) + MessageBoxPlain("Throne Updater", "Update failed. Please close the running instance and run the updater again.\n\n"+err.Error()) log.Fatalln(err.Error()) } - os.RemoveAll("./nekoray_update") - os.RemoveAll("./nekoray.zip") - os.RemoveAll("./nekoray.tar.gz") + os.RemoveAll("./Throne_update") + os.RemoveAll("./Throne.zip") + os.RemoveAll("./Throne.tar.gz") } func Exist(path string) bool {