erlang - VerneMQ plugin force disconnect client -


i'm developing vernemq plugin jwt authentication in need disconnect client inside auth_on_publish plugin if it's jwt token expired.

is possible close connection inside plugin hook?

i found answer on vernemq slack channel, provided vernemq developer himself:

all auth_on_x hooks executed in mqtt session process, can send disconnect message this: self() ! disconnect, , client disconnected.

so, inside auth_on_publish plugin, when authentication expires, run self() ! disconnect , client disconnected desired.

note, however, using internals of vernemq , not guaranteed work forever. no 'official' api exists feature.


Comments

Popular posts from this blog

html - How to custom Bootstrap grid height? -

javascript - pass values from mssql to views in node -

javascript - Understanding ExtJS Framework Syntax -