Software / code / prosody
Comparison
plugins/mod_admin_telnet.lua @ 10663:fd651ba2317f
mod_admin_telnet: Allow passing list of hosts to http:list()
Lets you select what hosts to list http services on. In particular, this
enables listing global http services, which was not possible before.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 24 Feb 2020 18:38:09 +0100 |
| parent | 10658:52c6dfa04dba |
| child | 10701:929c95e518f0 |
comparison
equal
deleted
inserted
replaced
| 10662:46373b97e648 | 10663:fd651ba2317f |
|---|---|
| 1239 return true, "Cache:\n"..tostring(resolver._resolver.cache) | 1239 return true, "Cache:\n"..tostring(resolver._resolver.cache) |
| 1240 end | 1240 end |
| 1241 | 1241 |
| 1242 def_env.http = {}; | 1242 def_env.http = {}; |
| 1243 | 1243 |
| 1244 function def_env.http:list() | 1244 function def_env.http:list(hosts) |
| 1245 local print = self.session.print; | 1245 local print = self.session.print; |
| 1246 | 1246 |
| 1247 for host in pairs(prosody.hosts) do | 1247 for host in get_hosts_set(hosts) do |
| 1248 local http_apps = modulemanager.get_items("http-provider", host); | 1248 local http_apps = modulemanager.get_items("http-provider", host); |
| 1249 if #http_apps > 0 then | 1249 if #http_apps > 0 then |
| 1250 local http_host = module:context(host):get_option_string("http_host"); | 1250 local http_host = module:context(host):get_option_string("http_host"); |
| 1251 print("HTTP endpoints on "..host..(http_host and (" (using "..http_host.."):") or ":")); | 1251 print("HTTP endpoints on "..host..(http_host and (" (using "..http_host.."):") or ":")); |
| 1252 for _, provider in ipairs(http_apps) do | 1252 for _, provider in ipairs(http_apps) do |