mq连接的时候,开启了http认证,配置如下:
auth {
allow_anonymous = false
no_match = allow
deny_action = ignore
cache = {
max_size = 32
ttl = 1m
}
http_auth = {
auth_req {
url = "http://127.0.0.1:8011/aiot/MqttAuth/req"
method = "POST"
headers.content-type = "application/x-www-form-urlencoded"
params = {clientid = "%c", username = "%u", password = "%P"}
}
}
}
文档中没见有哪里说明http auth响应的内容格式说明。
然后再测试过程中发现一个体验很不好的问题,http auth好像只认http code,只要响应状态码是200就表示通过,可以连接了,没有不是200就不能连接。
不知道官方在这个功能上的设计是否是这样的,{“result”: “deny”} 这样的响应并没有什么效果。。。。