mod_srvinjection/README.markdown
changeset 1807 4d73a1a6ba68
parent 1786 29f3d6b7ad16
equal deleted inserted replaced
1806:0ab737feada6 1807:4d73a1a6ba68
       
     1 ---
       
     2 labels:
       
     3 - 'Stage-Beta'
       
     4 summary: Manually specify SRV records
       
     5 ...
       
     6 
       
     7 Introduction
       
     8 ============
       
     9 
       
    10 This Prosody plugin lets you manually override SRV records used for a
       
    11 remote host.
       
    12 
       
    13 Usage
       
    14 =====
       
    15 
       
    16 Simply add `"srvinjection"` to your `modules_enabled` list to enable.
       
    17 Then add the `srvinjection` option to the global section.
       
    18 
       
    19 Configuration
       
    20 =============
       
    21 
       
    22 The `srvinjection` option can be used as follows:
       
    23 
       
    24     srvinjection = {
       
    25       ["example.com"] = {"localhost", 5000};
       
    26       ["jabber.org"] = {"localhost", 5001};
       
    27     };
       
    28 
       
    29 The format for individual items is
       
    30 `["remote-hostname"] = {"srv-hostname", srv-port};`.
       
    31 
       
    32 The special remote hostname `"*"` can be used as a wildcard:
       
    33 
       
    34         srvinjection = { ["*"] = {"xmpp-server.l.google.com", 5269} } -- Use Google's XMPP server for all hostnames
       
    35 
       
    36 Reloading
       
    37 =========
       
    38 
       
    39 The module can be reloaded via the telnet console. Edit the config file
       
    40 to make any updates.
       
    41 
       
    42 You can reload the configuration from disk:
       
    43 
       
    44     config:reload()
       
    45 
       
    46 And then reload the module to apply the configuration changes:
       
    47 
       
    48     module:reload("srvinjection", "*")
       
    49 
       
    50 Compatibility
       
    51 =============
       
    52 
       
    53   ----- -------
       
    54   0.8   Works
       
    55   0.7   Works
       
    56   0.6   Works
       
    57   ----- -------
       
    58 
       
    59 How it works
       
    60 ============
       
    61 
       
    62 The module replaces the `lookup` function of the `net.adns` module with
       
    63 its own. The original is set back when the module is unloaded.