Software /
code /
prosody
Diff
plugins/mod_websocket.lua @ 9378:a6f54df39624
mod_websocket: Serve HTTP in global context
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 22 Sep 2018 00:02:16 +0200 |
parent | 8794:0e2c1c4d4f78 |
child | 9415:02155a10c5e9 |
line wrap: on
line diff
--- a/plugins/mod_websocket.lua Sat Sep 22 00:01:21 2018 +0200 +++ b/plugins/mod_websocket.lua Sat Sep 22 00:02:16 2018 +0200 @@ -315,16 +315,17 @@ 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