summary refs log tree commit diff
path: root/synapse/http/federation/matrix_federation_agent.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-06-24 16:06:40 +0100
committerErik Johnston <erik@matrix.org>2021-06-24 16:06:40 +0100
commita77aab60ae90c8393f8f615521d5b538a72c5bd9 (patch)
treeda057045032da5876c1ccbf9f7d7f6ff38f9d3a6 /synapse/http/federation/matrix_federation_agent.py
parentMerge tag 'v1.37.0rc1' into develop (diff)
downloadsynapse-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.py16
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."""