wind-c / comqtt

A lightweight, high-performance go mqtt server(v3.0|v3.1.1|v5.0) supporting distributed cluster
MIT License
972 stars 53 forks source link

how to use plugin/auth #28

Closed Hayast closed 1 year ago

Hayast commented 1 year ago

How to use redis or mysql for plugin authentication? Can you provide code reference?

Hayast commented 1 year ago

I see. var auth iauth.Auth if cfg.AuthDatasource == "redis" { auth, err = rauth.New("./plugin/auth/redis/conf.yml") if err != nil { log.Fatal(err) } err = auth.Open() if err != nil { log.Fatal(err) } defer auth.Close() }

./plugin/auth/redis/conf.yml

change conf.yml redis port to my port addr: 127.0.0.1:63798 ok.