fix: issue with singbox 1.8.9

This commit is contained in:
Hiddify
2024-03-18 10:53:54 +01:00
parent aba593322e
commit aab998fae9
5 changed files with 51 additions and 38 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/hiddify/libcore/bridge"
"github.com/sagernet/sing-box/experimental/libbox"
"github.com/sagernet/sing-box/log"
)
var (
@@ -13,24 +14,24 @@ var (
)
type OldCommandClientHandler struct {
port int64
// logger log.Logger
port int64
logger log.Logger
}
func (cch *OldCommandClientHandler) Connected() {
// cch.logger.Debug("CONNECTED")
cch.logger.Debug("CONNECTED")
}
func (cch *OldCommandClientHandler) Disconnected(message string) {
// cch.logger.Debug("DISCONNECTED: ", message)
cch.logger.Debug("DISCONNECTED: ", message)
}
func (cch *OldCommandClientHandler) ClearLog() {
// cch.logger.Debug("clear log")
cch.logger.Debug("clear log")
}
func (cch *OldCommandClientHandler) WriteLog(message string) {
// cch.logger.Debug("log: ", message)
cch.logger.Debug("log: ", message)
}
func (cch *OldCommandClientHandler) WriteStatus(message *libbox.StatusMessage) {
@@ -44,7 +45,7 @@ func (cch *OldCommandClientHandler) WriteStatus(message *libbox.StatusMessage) {
"downlink-total": message.DownlinkTotal,
},
)
// cch.logger.Debug("Memory: ", libbox.FormatBytes(message.Memory), ", Goroutines: ", message.Goroutines)
cch.logger.Debug("Memory: ", libbox.FormatBytes(message.Memory), ", Goroutines: ", message.Goroutines)
if err != nil {
bridge.SendStringToPort(cch.port, fmt.Sprintf("error: %e", err))
} else {
@@ -83,11 +84,11 @@ func (cch *OldCommandClientHandler) WriteGroups(message libbox.OutboundGroupIter
}
func (cch *OldCommandClientHandler) InitializeClashMode(modeList libbox.StringIterator, currentMode string) {
// cch.logger.Debug("initial clash mode: ", currentMode)
cch.logger.Debug("initial clash mode: ", currentMode)
}
func (cch *OldCommandClientHandler) UpdateClashMode(newMode string) {
// cch.logger.Debug("update clash mode: ", newMode)
cch.logger.Debug("update clash mode: ", newMode)
}
type OutboundGroup struct {