Skip to content

Commit

Permalink
✨ config.json supports wss
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Dec 11, 2022
1 parent 34a3cf8 commit 8f009bb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ import (
type zbpcfg struct {
Z zero.Config `json:"zero"`
W []*driver.WSClient `json:"ws"`
S []*driver.WSServer `json:"wss"`
}

var config zbpcfg
Expand Down Expand Up @@ -250,10 +251,13 @@ func init() {
if err != nil {
panic(err)
}
config.Z.Driver = make([]zero.Driver, len(config.W))
config.Z.Driver = make([]zero.Driver, len(config.W)+len(config.S))
for i, w := range config.W {
config.Z.Driver[i] = w
}
for i, s := range config.S {
config.Z.Driver[i+len(config.W)] = s
}
logrus.Infoln("[main] 从", *runcfg, "读取配置文件")
return
}
Expand Down

0 comments on commit 8f009bb

Please sign in to comment.