# HG changeset patch # User Matthew Wild # Date 1450793709 0 # Node ID b2d160baa95726dd8ec35e4e2b272ec4621d316c # Parent 2d5751b2f21c4874858b509a6a50cdf02eb89b8e mod_admin_telnet: Backport 06696882d972 from 0.10 (this command greatly helps with debugging HTTP issues) diff -r 2d5751b2f21c -r b2d160baa957 plugins/mod_admin_telnet.lua --- a/plugins/mod_admin_telnet.lua Wed Dec 16 16:41:48 2015 +0000 +++ b/plugins/mod_admin_telnet.lua Tue Dec 22 14:15:09 2015 +0000 @@ -1081,6 +1081,33 @@ return true, "Cache:\n"..tostring(dns.cache()) end +def_env.http = {}; + +function def_env.http:list() + local print = self.session.print; + + for host in pairs(prosody.hosts) do + local http_apps = modulemanager.get_items("http-provider", host); + if #http_apps > 0 then + local http_host = module:context(host):get_option("http_host"); + print("HTTP endpoints on "..host..(http_host and (" (using "..http_host.."):") or ":")); + for _, provider in ipairs(http_apps) do + local url = module:context(host):http_url(provider.name); + print("", url); + end + print(""); + end + end + + local default_host = module:get_option("http_default_host"); + if not default_host then + print("HTTP requests to unknown hosts will return 404 Not Found"); + else + print("HTTP requests to unknown hosts will be handled by "..default_host); + end + return true; +end + ------------- function printbanner(session)