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_xhooks executed in mqtt session process, can senddisconnectmessage 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
Post a Comment