diff options
author | Matthew Wild <mwild1@gmail.com> | 2015-12-22 14:15:09 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2015-12-22 14:15:09 +0000 |
commit | aea8550ca241793e04baa6d717202edc50d7d9c2 (patch) | |
tree | 7127996d945aa39c9d298eb679c9a73d0f0325a3 /plugins/mod_admin_telnet.lua | |
parent | 17d6ea116ea31334f034d5f2433c2c4cff79e2ff (diff) | |
download | prosody-aea8550ca241793e04baa6d717202edc50d7d9c2.tar.gz prosody-aea8550ca241793e04baa6d717202edc50d7d9c2.zip |
mod_admin_telnet: Backport 06696882d972 from 0.10 (this command greatly helps with debugging HTTP issues)
Diffstat (limited to 'plugins/mod_admin_telnet.lua')
-rw-r--r-- | plugins/mod_admin_telnet.lua | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua index 437ded01..86403606 100644 --- a/plugins/mod_admin_telnet.lua +++ b/plugins/mod_admin_telnet.lua @@ -1081,6 +1081,33 @@ function def_env.dns:cache() 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) |