Mercurial > prosody-modules
view mod_compact_resource/mod_compact_resource.lua @ 4047:36b6e3e3f9e2
mod_conversejs: Disable automatic BOSH/WS endpoint discovery
Converse.js 7.0 will enable this by default, but when using this module
the BOSH and WebSocket endpoints are provided in the generated HTML, so
automatic discovery is not needed and unlikely to work without an
additional module.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 18 Jun 2020 15:24:34 +0200 |
parents | 6f34e51a23f0 |
children |
line wrap: on
line source
local base64_encode = require"util.encodings".base64.encode; local random_bytes = require"util.random".bytes; local b64url = { ["+"] = "-", ["/"] = "_", ["="] = "" }; local function random_resource() return base64_encode(random_bytes(8)):gsub("[+/=]", b64url); end module:hook("pre-resource-bind", function (event) event.resource = random_resource(); end);