Diff

util/prosodyctl/check.lua @ 12375:ea5e46601cfb

prosodyctl: check turn: show relayed address(es) in verbose mode
author Matthew Wild <mwild1@gmail.com>
date Sat, 05 Mar 2022 11:31:22 +0000
parent 12373:5417ec7e2ee8
child 12376:10353ad0ca7a
line wrap: on
line diff
--- a/util/prosodyctl/check.lua	Sat Mar 05 11:30:55 2022 +0000
+++ b/util/prosodyctl/check.lua	Sat Mar 05 11:31:22 2022 +0000
@@ -158,6 +158,8 @@
 		return result;
 	end
 
+	result.relayed_addresses = alloc_response:get_xor_relayed_addresses();
+
 	if not ping_service then
 		-- Success! We won't be running the relay test.
 		return result;
@@ -1247,6 +1249,11 @@
 			else
 				if opts.verbose then
 					print(("External IP: %s"):format(result.external_ip.address));
+					if result.relayed_addresses then
+						for i, relayed_address in ipairs(result.relayed_addresses) do
+							print(("Relayed address %d: %s:%d"):format(i, relayed_address.address, relayed_address.port));
+						end
+					end
 					if result.external_ip_pong then
 						print(("TURN external IP: %s"):format(result.external_ip_pong.address));
 					end