iegomez / mosquitto-go-auth

Auth plugin for mosquitto.
MIT License
514 stars 169 forks source link

Message/events in the plugin when the client is disconnected #262

Open kitty7c6 opened 1 year ago

kitty7c6 commented 1 year ago

Hello, is it currently planned (or perhaps already implemented) to trigger a message/events in the plugin when the client is disconnected from the broker (http)? I find issues https://github.com/iegomez/mosquitto-go-auth/issues/106 and https://github.com/iegomez/mosquitto-go-auth/issues/215. Now I can use LWT and send message from remote client before disconnect, but message from plugin will be more interesting for server solution

iegomez commented 1 year ago

Hi! Sadly it's neither implemented nor planned, but I'd welcome a contribution to support such case if it was general enough.

zhyang-liu commented 5 months ago

same question met on postgres backend, and thinking about if there is a way to fix. if i can fix the problem, i'll try making the codes go public.

it seems like just do save DB in the struct and just open a connection when interface functions such as GetUser is called.