Software /
code /
prosody-modules
Comparison
mod_http_altconnect/mod_http_altconnect.lua @ 1325:b21236b6b8d8
Backed out changeset 853a382c9bd6
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 28 Feb 2014 15:37:55 +0100 |
parent | 1324:853a382c9bd6 |
child | 3712:0a0bf87ccda6 |
comparison
equal
deleted
inserted
replaced
1324:853a382c9bd6 | 1325:b21236b6b8d8 |
---|---|
4 module:depends"http"; | 4 module:depends"http"; |
5 | 5 |
6 local json = require"util.json"; | 6 local json = require"util.json"; |
7 local st = require"util.stanza"; | 7 local st = require"util.stanza"; |
8 local array = require"util.array"; | 8 local array = require"util.array"; |
9 local it = require"util.iterators"; | |
10 | 9 |
11 local host_modules = hosts[module.host].modules; | 10 local host_modules = hosts[module.host].modules; |
12 | 11 |
13 local function get_supported() | 12 local function get_supported() |
14 local uris = array(it.values(module:get_host_items("alt-conn-method"))); | 13 local uris = array(); |
15 if #uris == 0 then | 14 if host_modules["bosh"] then |
16 -- COMPAT for with before item array was added | 15 uris:push({ rel = "urn:xmpp:alt-connections:xbosh", href = module:http_url("bosh", "/http-bind") }); |
17 if host_modules["bosh"] then | 16 end |
18 uris:push({ rel = "urn:xmpp:alt-connections:xbosh", href = module:http_url("bosh", "/http-bind") }); | 17 if host_modules["websocket"] then |
19 end | 18 uris:push({ rel = "urn:xmpp:alt-connections:websocket", href = module:http_url("websocket", "xmpp-websocket"):gsub("^http", "ws") }); |
20 if host_modules["websocket"] then | |
21 uris:push({ rel = "urn:xmpp:alt-connections:websocket", href = module:http_url("websocket", "xmpp-websocket"):gsub("^http", "ws") }); | |
22 end | |
23 end | 19 end |
24 return uris; | 20 return uris; |
25 end | 21 end |
26 | 22 |
27 | 23 |