prosodyctl: check turn: Fail with error if our own address is supplied for the ping test 0.12
authorMatthew Wild <mwild1@gmail.com>
Sat, 19 Mar 2022 11:09:10 +0000
branch0.12
changeset 12420 19fd28239e73
parent 12418 a93e65784f2c
child 12421 3635b0bfbd55
child 12422 dd47adf74e93
prosodyctl: check turn: Fail with error if our own address is supplied for the ping test
util/prosodyctl/check.lua
--- a/util/prosodyctl/check.lua	Sat Mar 19 09:28:27 2022 +0000
+++ b/util/prosodyctl/check.lua	Sat Mar 19 11:09:10 2022 +0000
@@ -180,6 +180,12 @@
 		-- Only a hostname specified, use default STUN port
 		ping_host, ping_port = ping_service, 3478;
 	end
+
+	if ping_host == turn_service.host then
+		result.error = ("Unable to perform ping test: please supply an external STUN server address. See https://prosody.im/doc/turn#prosodyctl-check");
+		return result;
+	end
+
 	local ping_service_ip, err = socket.dns.toip(ping_host);
 	if not ping_service_ip then
 		result.error = "Unable to resolve ping service hostname: "..err;