local st = require "util.stanza";
local logger = require "util.logger";
local log = logger.init("mod_bosh");
+local initialize_filters = require "util.filters".initialize;
local math_min = math.min;
local xmlns_streams = "http://etherx.jabber.org/streams";
local consider_bosh_secure = module:get_option_boolean("consider_bosh_secure");
-local default_headers = { ["Content-Type"] = "text/xml; charset=utf-8" };
+local default_headers = { ["Content-Type"] = "text/xml; charset=utf-8", ["Connection"] = "keep-alive" };
local cross_domain = module:get_option("cross_domain_bosh", false);
if cross_domain then
};
sessions[sid] = session;
+ local filter = initialize_filters(session);
+
session.log("debug", "BOSH session created for request from %s", session.ip);
log("info", "New BOSH session, assigned it sid '%s'", sid);
s = st.clone(s);
s.attr.xmlns = "jabber:client";
end
+ s = filter("stanzas/out", s);
--log("debug", "Sending BOSH data: %s", tostring(s));
t_insert(session.send_buffer, tostring(s));
if stanza.attr.xmlns == xmlns_bosh then
stanza.attr.xmlns = nil;
end
+ stanza = session.filter("stanzas/in", stanza);
core_process_stanza(session, stanza);
end
end