diff options
author | Andrew Morgan <andrew@amorgan.xyz> | 2019-01-16 17:36:16 +0000 |
---|---|---|
committer | Andrew Morgan <andrew@amorgan.xyz> | 2019-01-16 17:36:20 +0000 |
commit | 1128d9b9b2817c8277b75c8d1e70b9747ae6a3fb (patch) | |
tree | 909659c90e45de61694d0962c941709746838d76 | |
parent | Add changelog file (diff) | |
download | synapse-1128d9b9b2817c8277b75c8d1e70b9747ae6a3fb.tar.xz |
Clarify this is not for use with a SOCKS proxy
-rw-r--r-- | synapse/config/server.py | 16 | ||||
-rw-r--r-- | synapse/http/matrixfederationclient.py | 6 |
2 files changed, 12 insertions, 10 deletions
diff --git a/synapse/config/server.py b/synapse/config/server.py index 33c173127c..395daa3c01 100644 --- a/synapse/config/server.py +++ b/synapse/config/server.py @@ -109,8 +109,8 @@ class ServerConfig(Config): ) # Optional proxy address for federation traffic - self.proxy_federation_requests_address = config.get( - "proxy_federation_requests_address", None + self.federation_request_gateway_addr = config.get( + "federation_request_gateway_addr", None ) # turn the whitelist into a hash for speed of lookup @@ -119,10 +119,10 @@ class ServerConfig(Config): for domain in federation_domain_whitelist: self.federation_domain_whitelist[domain] = True - if self.proxy_federation_requests_address is not None: + if self.federation_request_gateway_addr 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 len(self.federation_request_gateway_addr.split(':')) != 2: + self.federation_request_gateway_addr = None if self.public_baseurl is not None: if self.public_baseurl[-1] != '/': @@ -300,8 +300,10 @@ class ServerConfig(Config): # - nyc.example.com # - syd.example.com - # Proxy outbound federation requests through a seperate HTTP proxy. - # proxy_federation_requests_address: localhost:1234 + # Send outbound federation requests through a seperate traffic gateway. + # Not intended to be used with a SOCKS proxy, but rather a relay for + # HTTP traffic. + # federation_request_gateway_addr: localhost:1234 # List of ports that Synapse should listen on, their purpose and their # configuration. diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py index abe9c0cbc5..e1fc1f1c56 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py @@ -71,7 +71,7 @@ class ProxyMatrixFederationEndpointFactory(object): def endpointForURI(self, uri): return matrix_federation_endpoint( - self.reactor, self.hs.proxy_federation_requests_address, timeout=10, + self.reactor, self.hs.federation_request_gateway_addr, timeout=10, tls_client_options_factory=None ) @@ -196,14 +196,14 @@ class MatrixFederationHttpClient(object): self.hs = hs self.signing_key = hs.config.signing_key[0] self.server_name = hs.hostname - self.proxy_addr = hs.config.proxy_federation_requests_address + self.gateway_addr = hs.config.federation_request_gateway_addr reactor = hs.get_reactor() pool = HTTPConnectionPool(reactor) pool.retryAutomatically = False pool.maxPersistentPerHost = 5 pool.cachedConnectionTimeout = 2 * 60 - if self.proxy_addr: + if self.gateway_addr: self.agent = Agent.usingEndpointFactory( reactor, ProxyMatrixFederationEndpointFactory(hs), pool=pool ) |