From 6e9777081fff906edd2021c674bfa14d05799c21 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 22 Sep 2018 00:02:16 +0200 Subject: mod_websocket: Serve HTTP in global context --- plugins/mod_websocket.lua | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'plugins/mod_websocket.lua') diff --git a/plugins/mod_websocket.lua b/plugins/mod_websocket.lua index d301088e..f981e871 100644 --- a/plugins/mod_websocket.lua +++ b/plugins/mod_websocket.lua @@ -315,16 +315,17 @@ 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: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); if cross_domain ~= true then -- cgit v1.2.3