aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/mod_bosh.lua24
-rw-r--r--plugins/mod_websocket.lua26
2 files changed, 28 insertions, 22 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();
diff --git a/plugins/mod_websocket.lua b/plugins/mod_websocket.lua
index 80296c5b..04a8303a 100644
--- a/plugins/mod_websocket.lua
+++ b/plugins/mod_websocket.lua
@@ -348,18 +348,20 @@ local function keepalive(event)
end
end
-module:hook("c2s-read-timeout", keepalive, -0.9);
-
-module:depends("http");
-module:provides("http", {
- name = "websocket";
- default_path = "xmpp-websocket";
- route = {
- ["GET"] = handle_request;
- ["GET /"] = handle_request;
- };
-});
-
function module.add_host(module)
module:hook("c2s-read-timeout", keepalive, -0.9);
+
+ module:depends("http");
+ module:provides("http", {
+ name = "websocket";
+ default_path = "xmpp-websocket";
+ route = {
+ ["GET"] = handle_request;
+ ["GET /"] = handle_request;
+ };
+ });
+
+ module:hook("c2s-read-timeout", keepalive, -0.9);
end
+
+module:add_host();