Software /
code /
prosody
Comparison
plugins/mod_websocket.lua @ 11540:1937b3c3efb5 0.11
mod_c2s, mod_s2s, mod_component, mod_bosh, mod_websockets: Set default stanza size limits
c2s/bosh/ws streams will default to 256KB, s2s and components to 512KB.
These values are aligned with ejabberd's default settings, which should reduce
issues related to inconsistent size limits between servers on the XMPP network.
The previous default (10MB) is excessive for any production server, and allows
significant memory usage by even unauthenticated sessions.
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 07 May 2021 17:03:49 +0100 |
parent | 11113:10301c214f4e |
child | 11560:3bbb1af92514 |
comparison
equal
deleted
inserted
replaced
11539:3413fea9e6db | 11540:1937b3c3efb5 |
---|---|
26 local build_close = websocket_frames.build_close; | 26 local build_close = websocket_frames.build_close; |
27 local parse_close = websocket_frames.parse_close; | 27 local parse_close = websocket_frames.parse_close; |
28 | 28 |
29 local t_concat = table.concat; | 29 local t_concat = table.concat; |
30 | 30 |
31 local stanza_size_limit = module:get_option_number("c2s_stanza_size_limit", 10 * 1024 * 1024); | 31 local stanza_size_limit = module:get_option_number("c2s_stanza_size_limit", 1024 * 256); |
32 local frame_buffer_limit = module:get_option_number("websocket_frame_buffer_limit", 2 * stanza_size_limit); | 32 local frame_buffer_limit = module:get_option_number("websocket_frame_buffer_limit", 2 * stanza_size_limit); |
33 local frame_fragment_limit = module:get_option_number("websocket_frame_fragment_limit", 8); | 33 local frame_fragment_limit = module:get_option_number("websocket_frame_fragment_limit", 8); |
34 local stream_close_timeout = module:get_option_number("c2s_close_timeout", 5); | 34 local stream_close_timeout = module:get_option_number("c2s_close_timeout", 5); |
35 local consider_websocket_secure = module:get_option_boolean("consider_websocket_secure"); | 35 local consider_websocket_secure = module:get_option_boolean("consider_websocket_secure"); |
36 local cross_domain = module:get_option_set("cross_domain_websocket", {}); | 36 local cross_domain = module:get_option_set("cross_domain_websocket", {}); |