Implement file-based configuration

This commit is contained in:
mochi-co
2023-12-25 00:28:49 +00:00
parent 5058333f36
commit ac5863644a
42 changed files with 1072 additions and 193 deletions

View File

@@ -27,7 +27,10 @@ func main() {
server := mqtt.New(nil)
_ = server.AddHook(new(auth.AllowHook), nil)
ws := listeners.NewWebsocket("ws1", ":1882", nil)
ws := listeners.NewWebsocket(listeners.Config{
ID: "ws1",
Address: ":1882",
})
err := server.AddListener(ws)
if err != nil {
log.Fatal(err)