annotate mod_s2sout_override/README.md @ 5486:71243bedb2b0

mod_s2sout_override: New module for overriding s2s connections This takes advantage of the new event added in Prosody rev d5f322dd424b which enables a cleaner way to override the connection using a resolver.
author Kim Alvefur <zash@zash.se>
date Wed, 24 May 2023 15:56:26 +0200
parents
children 6cf2f32dbf40
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5486
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
1 ---
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
2 summary: Override s2s connection targets
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
3 ---
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
4
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
5 This module replaces [mod_s2soutinjection] and uses more modern and
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
6 reliable methods for overriding connection targets.
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
7
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
8 # Configuration
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
9
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
10 Enable the module as usual, then specify a map of XMPP remote hostnames
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
11 to URIs like `"tcp://host.example:port"`, to have Prosody connect there
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
12 instead of doing normal DNS SRV resolution.
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
13
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
14 Currently only the `tcp://` scheme is supported. A future version could
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
15 support more methods including Direct TLS, alternate SRV lookup targets
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
16 or even UNIX sockets.
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
17
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
18 ```lua
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
19 -- Global section
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
20 modules_enabled = {
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
21 -- other global modules
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
22 "s2sout_override";
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
23 }
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
24
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
25 s2sout_override = {
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
26 ["example.com"] = "tcp://other.host.example:5299";
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
27 ["xmpp.example.net"] = "tcp://localhost:5999";
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
28 }
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
29 ```
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
30
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
31 # Compatibility
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
32
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
33 Prosody version status
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
34 --------------- ----------
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
35 0.12.4 Will work
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
36 0.12.3 Will not work
71243bedb2b0 mod_s2sout_override: New module for overriding s2s connections
Kim Alvefur <zash@zash.se>
parents:
diff changeset
37 0.11 Will not work