Comparison

util/prosodyctl/check.lua @ 12416:19fd28239e73 0.12

prosodyctl: check turn: Fail with error if our own address is supplied for the ping test
author Matthew Wild <mwild1@gmail.com>
date Sat, 19 Mar 2022 11:09:10 +0000
parent 12414:a93e65784f2c
child 12441:dc6263625069
comparison
equal deleted inserted replaced
12414:a93e65784f2c 12416:19fd28239e73
178 ping_port = tonumber(ping_port); 178 ping_port = tonumber(ping_port);
179 else 179 else
180 -- Only a hostname specified, use default STUN port 180 -- Only a hostname specified, use default STUN port
181 ping_host, ping_port = ping_service, 3478; 181 ping_host, ping_port = ping_service, 3478;
182 end 182 end
183
184 if ping_host == turn_service.host then
185 result.error = ("Unable to perform ping test: please supply an external STUN server address. See https://prosody.im/doc/turn#prosodyctl-check");
186 return result;
187 end
188
183 local ping_service_ip, err = socket.dns.toip(ping_host); 189 local ping_service_ip, err = socket.dns.toip(ping_host);
184 if not ping_service_ip then 190 if not ping_service_ip then
185 result.error = "Unable to resolve ping service hostname: "..err; 191 result.error = "Unable to resolve ping service hostname: "..err;
186 return result; 192 return result;
187 end 193 end