From a77aab60ae90c8393f8f615521d5b538a72c5bd9 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Thu, 24 Jun 2021 16:06:40 +0100 Subject: Use a local federation proxy --- synapse/http/federation/matrix_federation_agent.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/synapse/http/federation/matrix_federation_agent.py b/synapse/http/federation/matrix_federation_agent.py index 950770201a..1b960b6a02 100644 --- a/synapse/http/federation/matrix_federation_agent.py +++ b/synapse/http/federation/matrix_federation_agent.py @@ -84,8 +84,8 @@ class MatrixFederationAgent: self._agent = Agent.usingEndpointFactory( self._reactor, - MatrixHostnameEndpointFactory( - reactor, tls_client_options_factory, _srv_resolver + ProxyHostnameEndpointFactory( + reactor, ), pool=self._pool, ) @@ -193,6 +193,18 @@ class MatrixFederationAgent: return res +@implementer(IAgentEndpointFactory) +class ProxyHostnameEndpointFactory: + def __init__( + self, + reactor: IReactorCore, + ): + self._reactor = reactor + + def endpointForURI(self, parsed_uri): + return HostnameEndpoint(self._reactor, "127.0.0.1", 3000) + + @implementer(IAgentEndpointFactory) class MatrixHostnameEndpointFactory: """Factory for MatrixHostnameEndpoint for parsing to an Agent.""" -- cgit 1.5.1