diff options
author | Erik Johnston <erik@matrix.org> | 2021-06-24 16:06:40 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2021-06-24 16:06:40 +0100 |
commit | a77aab60ae90c8393f8f615521d5b538a72c5bd9 (patch) | |
tree | da057045032da5876c1ccbf9f7d7f6ff38f9d3a6 /synapse/http/federation/matrix_federation_agent.py | |
parent | Merge tag 'v1.37.0rc1' into develop (diff) | |
download | synapse-a77aab60ae90c8393f8f615521d5b538a72c5bd9.tar.xz |
Use a local federation proxy
Diffstat (limited to 'synapse/http/federation/matrix_federation_agent.py')
-rw-r--r-- | synapse/http/federation/matrix_federation_agent.py | 16 |
1 files 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, ) @@ -194,6 +194,18 @@ class MatrixFederationAgent: @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.""" |