emqx-extension-examples
emqx-extension-examples copied to clipboard
Examples for ExHook & ExProto
This is a demo server written in Rust for exhook
1. 在hook的`OnClientAuthenticate` 里加上 `is_supperuser` 字段。验证用户时,需要判断是否超级用户。 2. 在hook的`OnMessagePublish`里带下ClientInfo,大部分接口都有这个,而`OnMessagePublish`里偏偏没有。
When the client unsubscribes to a specific topic, the unsubscribe topic name information cannot found in the exhook event request. - OS: CentOS 7 - Version: emqx 5.2.0 The build...
peerhost :客户端IP sockport : 服务端端口 有没有办法获取到客户端的端口
当设备第一次连接的时候,我通过 `timer = exproto_pb2.TimerRequest(conn=request.conn, type=exproto_pb2.TimerType.KEEPALIVE, interval=120) response = self.stub.StartTimer(timer) ` 启动定时器将120*3s不发消息的设备踢掉。 我的设备是1分钟一条数据,但是当第四分钟数据收到解析完毕之后,通过 `publish = exproto_pb2.PublishRequest(conn=request.conn, topic="/$sys/username/clientId/upload", qos=1, payload=json.dumps(data).encode("utf-8") ) self.stub.Publish(publish)`发布的时候,会出现异常,显示 `2023-03-03 15:59:00,588 ERROR:root:OnReceivedBytes 2023-03-03 15:59:00,588 ERROR:root: ` 然后我每次发布消息之后重新使用定时器,就不再出现异常了。不知道什么原因造成的。 一、4分钟远不到定时器设置的时间 二、且没有触发定时器超时的函数`OnTimerTimeout`
when i hook all the method in emqx , and i already can visit the hook info in admin webside. but my program cant hook onclientauthorize when i use emq...
目前只要知道emqx服务的ip和udp端口就都可以接入进来,有点不安全,我只想让特定mac地址的设备接入,该如何做鉴权处理?