Comparison

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
comparison
equal deleted inserted replaced
12374:0602245fc84e 12375:ea5e46601cfb
155 return result; 155 return result;
156 elseif not alloc_response:is_success_resp() then 156 elseif not alloc_response:is_success_resp() then
157 result.error = ("Unexpected TURN response: %d (%s)"):format(alloc_response:get_type()); 157 result.error = ("Unexpected TURN response: %d (%s)"):format(alloc_response:get_type());
158 return result; 158 return result;
159 end 159 end
160
161 result.relayed_addresses = alloc_response:get_xor_relayed_addresses();
160 162
161 if not ping_service then 163 if not ping_service then
162 -- Success! We won't be running the relay test. 164 -- Success! We won't be running the relay test.
163 return result; 165 return result;
164 end 166 end
1245 print("Error: "..result.error.."\n"); 1247 print("Error: "..result.error.."\n");
1246 ok = false; 1248 ok = false;
1247 else 1249 else
1248 if opts.verbose then 1250 if opts.verbose then
1249 print(("External IP: %s"):format(result.external_ip.address)); 1251 print(("External IP: %s"):format(result.external_ip.address));
1252 if result.relayed_addresses then
1253 for i, relayed_address in ipairs(result.relayed_addresses) do
1254 print(("Relayed address %d: %s:%d"):format(i, relayed_address.address, relayed_address.port));
1255 end
1256 end
1250 if result.external_ip_pong then 1257 if result.external_ip_pong then
1251 print(("TURN external IP: %s"):format(result.external_ip_pong.address)); 1258 print(("TURN external IP: %s"):format(result.external_ip_pong.address));
1252 end 1259 end
1253 end 1260 end
1254 print("Success!\n"); 1261 print("Success!\n");