Software / code / prosody
Comparison
plugins/mod_websocket.lua @ 6893:861790282dda
mod_websocket: Import util.timer and session close timeout config option (thanks fairuz)
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 06 Oct 2015 15:27:39 +0200 |
| parent | 6793:2bf1b7e2149a |
| child | 6894:f7203c7cb7ff |
comparison
equal
deleted
inserted
replaced
| 6891:7f76c77ddcb8 | 6893:861790282dda |
|---|---|
| 5 -- COPYING file in the source package for more information. | 5 -- COPYING file in the source package for more information. |
| 6 -- | 6 -- |
| 7 | 7 |
| 8 module:set_global(); | 8 module:set_global(); |
| 9 | 9 |
| 10 local add_task = require "util.timer".add_task; | |
| 10 local add_filter = require "util.filters".add_filter; | 11 local add_filter = require "util.filters".add_filter; |
| 11 local sha1 = require "util.hashes".sha1; | 12 local sha1 = require "util.hashes".sha1; |
| 12 local base64 = require "util.encodings".base64.encode; | 13 local base64 = require "util.encodings".base64.encode; |
| 13 local st = require "util.stanza"; | 14 local st = require "util.stanza"; |
| 14 local parse_xml = require "util.xml".parse; | 15 local parse_xml = require "util.xml".parse; |
| 22 local build_close = websocket_frames.build_close; | 23 local build_close = websocket_frames.build_close; |
| 23 local parse_close = websocket_frames.parse_close; | 24 local parse_close = websocket_frames.parse_close; |
| 24 | 25 |
| 25 local t_concat = table.concat; | 26 local t_concat = table.concat; |
| 26 | 27 |
| 28 local stream_close_timeout = module:get_option_number("c2s_close_timeout", 5); | |
| 27 local consider_websocket_secure = module:get_option_boolean("consider_websocket_secure"); | 29 local consider_websocket_secure = module:get_option_boolean("consider_websocket_secure"); |
| 28 local cross_domain = module:get_option("cross_domain_websocket"); | 30 local cross_domain = module:get_option("cross_domain_websocket"); |
| 29 if cross_domain then | 31 if cross_domain then |
| 30 if cross_domain == true then | 32 if cross_domain == true then |
| 31 cross_domain = "*"; | 33 cross_domain = "*"; |