diff options
author | Kim Alvefur <zash@zash.se> | 2021-06-21 22:50:23 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-06-21 22:50:23 +0200 |
commit | e7df432614fc16a06f75c3e038176820f92a320d (patch) | |
tree | e213771171988fbc3e6b18267bf63b3c22d93bd5 /plugins/mod_bosh.lua | |
parent | 8bde7461c18460e4fbbc87be6d0853d2a645d5ba (diff) | |
download | prosody-e7df432614fc16a06f75c3e038176820f92a320d.tar.gz prosody-e7df432614fc16a06f75c3e038176820f92a320d.zip |
mod_bosh,mod_websocket: Make into global-shared modules (...again)
Global modules aren't quite considered loaded onto hosts, which
causes confusion in some cases. They are also reported in the log as
being served on http://*:5280/foo which is also a bit confusing, and
can't be clicked.
Global modules also have to have their paths configured in the global
section, which could be confusing and unexpected.
This global+shared method should be the best of both worlds.
Diffstat (limited to 'plugins/mod_bosh.lua')
-rw-r--r-- | plugins/mod_bosh.lua | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua index c337c03c..7bf241cd 100644 --- a/plugins/mod_bosh.lua +++ b/plugins/mod_bosh.lua @@ -543,13 +543,17 @@ local function GET_response(event) }) or "This is the Prosody BOSH endpoint."; end -module:depends("http"); -module:provides("http", { - default_path = "/http-bind"; - route = { - ["GET"] = GET_response; - ["GET /"] = GET_response; - ["POST"] = handle_POST; - ["POST /"] = handle_POST; - }; -}); +function module.add_host(module) + module:depends("http"); + module:provides("http", { + default_path = "/http-bind"; + route = { + ["GET"] = GET_response; + ["GET /"] = GET_response; + ["POST"] = handle_POST; + ["POST /"] = handle_POST; + }; + }); +end + +module:add_host(); |