Diff

plugins/mod_admin_telnet.lua @ 9454:6780049be177

mod_admin_telnet: Allow viewing HTTP event listeners via debug:events('http')
author Matthew Wild <mwild1@gmail.com>
date Tue, 09 Oct 2018 15:02:44 +0100
parent 9411:62c876e333e4
child 9691:e11e076f0eb8
child 10618:232841373711
line wrap: on
line diff
--- a/plugins/mod_admin_telnet.lua	Tue Oct 09 15:01:34 2018 +0100
+++ b/plugins/mod_admin_telnet.lua	Tue Oct 09 15:02:44 2018 +0100
@@ -1143,10 +1143,13 @@
 function def_env.debug:events(host, event)
 	local events_obj;
 	if host and host ~= "*" then
-		if not prosody.hosts[host] then
+		if host == "http" then
+			events_obj = require "net.http.server"._events;
+		elseif not prosody.hosts[host] then
 			return false, "Unknown host: "..host;
+		else
+			events_obj = prosody.hosts[host].events;
 		end
-		events_obj = prosody.hosts[host].events;
 	else
 		events_obj = prosody.events;
 	end