I want to make a service which used by third party website, their users connect to my hivemq server using websocket, I want to just allow these authorized website users to connect to my broker.
So I want to write a hivemq plugin to check the origin.
I want to ask how to archive this, or if there's a better solution.
thanks in advance.
You need to write an hivemq custom extension that would authenticate the users based on a secret paraphrase with thier client_name.
Checking against origin is a bad design cause origin can be mocked for the client. Originally you should go with authentication.
For workaround, you can ask your mqtt clients name to define something as client_name_secret Then on connection, you can match the name against a regex or you can also have a table for secret.
You can take a look on how to write an extention here - https://www.hivemq.com/docs/hivemq/4.6/extensions/introduction.html#quickstart https://github.com/hivemq/hivemq-extension-sdk