summary refs log tree commit diff
path: root/synapse/config
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2019-01-16 14:21:34 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2019-01-16 17:17:50 +0000
commit6a83652deed30637d597ee45bfe1804ce67c2595 (patch)
treea351f7321ec271611694033fbd9b8eaba8ee420b /synapse/config
parentMerge Synapse v0.34.1.1 (diff)
downloadsynapse-6a83652deed30637d597ee45bfe1804ce67c2595.tar.xz
Allow for Synapse to run through a http proxy
Signed-off-by: Andrew Morgan <andrew@amorgan.xyz>
Diffstat (limited to 'synapse/config')
-rw-r--r--synapse/config/server.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/synapse/config/server.py b/synapse/config/server.py
index fb57791098..33c173127c 100644
--- a/synapse/config/server.py
+++ b/synapse/config/server.py
@@ -107,12 +107,23 @@ class ServerConfig(Config):
         federation_domain_whitelist = config.get(
             "federation_domain_whitelist", None
         )
+
+        # Optional proxy address for federation traffic
+        self.proxy_federation_requests_address = config.get(
+            "proxy_federation_requests_address", None
+        )
+
         # turn the whitelist into a hash for speed of lookup
         if federation_domain_whitelist is not None:
             self.federation_domain_whitelist = {}
             for domain in federation_domain_whitelist:
                 self.federation_domain_whitelist[domain] = True
 
+        if self.proxy_federation_requests_address is not None:
+            # Ensure proxy address is correctly formatted
+            if len(self.proxy_federation_requests_address.split(':')) != 2:
+                self.proxy_federation_requests_address = None
+
         if self.public_baseurl is not None:
             if self.public_baseurl[-1] != '/':
                 self.public_baseurl += '/'
@@ -289,6 +300,9 @@ class ServerConfig(Config):
         #  - nyc.example.com
         #  - syd.example.com
 
+        # Proxy outbound federation requests through a seperate HTTP proxy.
+        # proxy_federation_requests_address: localhost:1234
+
         # List of ports that Synapse should listen on, their purpose and their
         # configuration.
         listeners: