tokers commented on a change in pull request #4391:
URL: https://github.com/apache/apisix/pull/4391#discussion_r648207010



##########
File path: apisix/stream/plugins/mqtt-proxy.lua
##########
@@ -159,16 +165,38 @@ function _M.preread(conf, ctx)
 
     core.log.info("mqtt client id: ", res.client_id)
 
+    local host = conf.upstream.host
+    if not host then
+        host = conf.upstream.ip
+    end
+
+    if conf.host_is_domain == nil then
+        conf.host_is_domain = not ipmatcher.parse_ipv4(host)
+                              and not ipmatcher.parse_ipv6(host)
+    end
+
+    if conf.host_is_domain then
+        local ip, err = core.resolver.parse_domain(host)
+        if not ip then
+            core.log.error("failed to parse host ", host, ", err: ", err)
+            return 500

Review comment:
       OK, got it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to