Chat Federation: first working PoC!

This commit is contained in:
John Livingston 2023-05-23 11:06:02 +02:00
parent 6fbfb8ef67
commit b525c203da
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
2 changed files with 5 additions and 0 deletions

View File

@ -36,6 +36,7 @@ local consider_websocket_secure = module:get_option_boolean("consider_websocket_
local xmlns_framing = "urn:ietf:params:xml:ns:xmpp-framing-server";
local xmlns_streams = "http://etherx.jabber.org/streams";
local xmlns_dialback = "jabber:server:dialback";
local xmlns_server = "jabber:server";
local stream_xmlns_attr = {xmlns='urn:ietf:params:xml:ns:xmpp-streams'};
@ -134,6 +135,7 @@ local function filter_open_close(data)
oc.name = "stream:stream";
oc.attr.xmlns = nil;
oc.attr["xmlns:stream"] = xmlns_streams;
oc.attr["xmlns:db"] = xmlns_dialback;
return oc:top_tag();
end
@ -651,6 +653,7 @@ function route_to_new_session(event)
session.open_stream = session_open_stream;
session.close = session_close;
session.secure = true; -- FIXME should test if protocol is wss or ws
local ex = {};
ex["headers"] = ws_properties.extra_headers or {};

View File

@ -296,6 +296,8 @@ class ProsodyConfigContent {
this.global.set('peertubelivechat_instance_url', publicServerUrl)
this.global.add('modules_enabled', 'websocket_s2s_peertubelivechat')
// s2s_close_timeout must be set accordingly with nginx timeout (30s)
this.global.set('s2s_close_timeout', 29)
// FIXME: seems to be necessary to add the module on the muc host, so that dialback can trigger route/remote.
this.muc.add('modules_enabled', 'websocket_s2s_peertubelivechat')