fix(internal\komari\ws): add websocket origin header to prevent 403; replace with json-rpc 2.0.

This commit is contained in:
2026-08-05 14:12:16 +08:00
parent 814fbe0dae
commit 6e93a9bd2f
4 changed files with 204 additions and 46 deletions
+2 -6
View File
@@ -44,9 +44,7 @@ func main() {
flag.Parse()
// Log startup banner.
postLog.Info(fmt.Sprintf("%s Ver.%s.%d.%s", softwareInfo.Name, softwareInfo.Version, softwareInfo.BuildVer, softwareInfo.BuildType))
postLog.Info(fmt.Sprintf("Developed by %s", softwareInfo.Developer))
postLog.Info(softwareInfo.Description)
postLog.Info(fmt.Sprintf("%s Ver.%s.%d.%s Developed by %s", softwareInfo.Name, softwareInfo.Version, softwareInfo.BuildVer, softwareInfo.BuildType, softwareInfo.Developer))
// Load configuration.
cfg, err := config.LoadConfig(*configPath)
@@ -59,9 +57,6 @@ func main() {
postLog.InitLogBroadcaster()
dbPath := cfg.DBPath
if dbPath == "" {
dbPath = "./db"
}
if err := postLog.InitLogsDatabase(fmt.Sprintf("%s/log.db", dbPath)); err != nil {
postLog.Fatal("Failed to initialize logs database: " + err.Error())
@@ -92,6 +87,7 @@ func main() {
if err := komari.LoginAndStart(); err != nil {
postLog.Fatal("Failed to login to Komari: " + err.Error())
return
}
// --- Start Komari WebSocket connection ---