Software / code / prosody
Comparison
plugins/mod_admin_telnet.lua @ 7982:e30b0cbed472
Merge 0.10->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 16 Mar 2017 23:49:27 +0100 |
| parent | 7923:81f3068fc30c |
| parent | 7977:01d6298de991 |
| child | 8128:c14513401d65 |
comparison
equal
deleted
inserted
replaced
| 7974:547f000941cf | 7982:e30b0cbed472 |
|---|---|
| 1146 local print = self.session.print; | 1146 local print = self.session.print; |
| 1147 | 1147 |
| 1148 for host in pairs(prosody.hosts) do | 1148 for host in pairs(prosody.hosts) do |
| 1149 local http_apps = modulemanager.get_items("http-provider", host); | 1149 local http_apps = modulemanager.get_items("http-provider", host); |
| 1150 if #http_apps > 0 then | 1150 if #http_apps > 0 then |
| 1151 local http_host = module:context(host):get_option("http_host"); | 1151 local http_host = module:context(host):get_option_string("http_host"); |
| 1152 print("HTTP endpoints on "..host..(http_host and (" (using "..http_host.."):") or ":")); | 1152 print("HTTP endpoints on "..host..(http_host and (" (using "..http_host.."):") or ":")); |
| 1153 for _, provider in ipairs(http_apps) do | 1153 for _, provider in ipairs(http_apps) do |
| 1154 local url = module:context(host):http_url(provider.name); | 1154 local url = module:context(host):http_url(provider.name); |
| 1155 print("", url); | 1155 print("", url); |
| 1156 end | 1156 end |
| 1157 print(""); | 1157 print(""); |
| 1158 end | 1158 end |
| 1159 end | 1159 end |
| 1160 | 1160 |
| 1161 local default_host = module:get_option("http_default_host"); | 1161 local default_host = module:get_option_string("http_default_host"); |
| 1162 if not default_host then | 1162 if not default_host then |
| 1163 print("HTTP requests to unknown hosts will return 404 Not Found"); | 1163 print("HTTP requests to unknown hosts will return 404 Not Found"); |
| 1164 else | 1164 else |
| 1165 print("HTTP requests to unknown hosts will be handled by "..default_host); | 1165 print("HTTP requests to unknown hosts will be handled by "..default_host); |
| 1166 end | 1166 end |