# HG changeset patch # User Matthew Wild # Date 1274466290 -3600 # Node ID 3238b58fd1184caff220f82d8fcf565687c0f6ef # Parent c3df9053e0a9539ee24120a4cd1e21e38d89dc1b mod_bosh: Add option consider_bosh_secure to treat BOSH sessions as encrypted even if they don't use HTTP (useful for when secure requests are proxied to Prosody over HTTP) diff -r c3df9053e0a9 -r 3238b58fd118 plugins/mod_bosh.lua --- a/plugins/mod_bosh.lua Fri May 21 19:20:21 2010 +0100 +++ b/plugins/mod_bosh.lua Fri May 21 19:24:50 2010 +0100 @@ -31,6 +31,8 @@ local BOSH_DEFAULT_REQUESTS = tonumber(module:get_option("bosh_max_requests")) or 2; local BOSH_DEFAULT_MAXPAUSE = tonumber(module:get_option("bosh_max_pause")) or 300; +local consider_bosh_secure = module:get_option_boolean("consider_bosh_secure"); + local default_headers = { ["Content-Type"] = "text/xml; charset=utf-8" }; local session_close_reply = { headers = default_headers, body = st.stanza("body", { xmlns = xmlns_bosh, type = "terminate" }), attr = {} }; @@ -177,7 +179,7 @@ local session = { type = "c2s_unauthed", conn = {}, sid = sid, rid = tonumber(attr.rid)-1, host = attr.to, bosh_version = attr.ver, bosh_wait = attr.wait, streamid = sid, bosh_hold = BOSH_DEFAULT_HOLD, bosh_max_inactive = BOSH_DEFAULT_INACTIVITY, requests = { }, send_buffer = {}, reset_stream = bosh_reset_stream, close = bosh_close_stream, - dispatch_stanza = core_process_stanza, log = logger.init("bosh"..sid), secure = request.secure }; + dispatch_stanza = core_process_stanza, log = logger.init("bosh"..sid), secure = consider_bosh_secure or request.secure }; sessions[sid] = session; log("info", "New BOSH session, assigned it sid '%s'", sid);