Comparison

plugins/mod_admin_telnet.lua @ 7977:01d6298de991

plugins/various: Use type-specific config API
author Kim Alvefur <zash@zash.se>
date Thu, 16 Mar 2017 20:46:06 +0100
parent 7911:e528d848a185
child 7982:e30b0cbed472
child 8126:60f6f7ddd2ce
comparison
equal deleted inserted replaced
7976:2a7ef5fcaa77 7977:01d6298de991
1109 local print = self.session.print; 1109 local print = self.session.print;
1110 1110
1111 for host in pairs(prosody.hosts) do 1111 for host in pairs(prosody.hosts) do
1112 local http_apps = modulemanager.get_items("http-provider", host); 1112 local http_apps = modulemanager.get_items("http-provider", host);
1113 if #http_apps > 0 then 1113 if #http_apps > 0 then
1114 local http_host = module:context(host):get_option("http_host"); 1114 local http_host = module:context(host):get_option_string("http_host");
1115 print("HTTP endpoints on "..host..(http_host and (" (using "..http_host.."):") or ":")); 1115 print("HTTP endpoints on "..host..(http_host and (" (using "..http_host.."):") or ":"));
1116 for _, provider in ipairs(http_apps) do 1116 for _, provider in ipairs(http_apps) do
1117 local url = module:context(host):http_url(provider.name); 1117 local url = module:context(host):http_url(provider.name);
1118 print("", url); 1118 print("", url);
1119 end 1119 end
1120 print(""); 1120 print("");
1121 end 1121 end
1122 end 1122 end
1123 1123
1124 local default_host = module:get_option("http_default_host"); 1124 local default_host = module:get_option_string("http_default_host");
1125 if not default_host then 1125 if not default_host then
1126 print("HTTP requests to unknown hosts will return 404 Not Found"); 1126 print("HTTP requests to unknown hosts will return 404 Not Found");
1127 else 1127 else
1128 print("HTTP requests to unknown hosts will be handled by "..default_host); 1128 print("HTTP requests to unknown hosts will be handled by "..default_host);
1129 end 1129 end