summary refs log tree commit diff
path: root/synapse/server.py
diff options
context:
space:
mode:
authorJason Little <realtyem@gmail.com>2023-05-09 13:25:20 -0500
committerGitHub <noreply@github.com>2023-05-09 14:25:20 -0400
commitd3bd03559b14272dd68499ab7cff4b190858b285 (patch)
treeae8783b4d21c8cd3fc22f31c70c3d02484cf6a1c /synapse/server.py
parentAdd config option to prevent media downloads from listed domains. (#15197) (diff)
downloadsynapse-d3bd03559b14272dd68499ab7cff4b190858b285.tar.xz
HTTP Replication Client (#15470)
Separate out a HTTP client for replication in preparation for
also supporting using UNIX sockets. The major difference from
the base class is that this does not use treq to handle HTTP
requests.
Diffstat (limited to 'synapse/server.py')
-rw-r--r--synapse/server.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/synapse/server.py b/synapse/server.py
index fd29c28173..b307295789 100644
--- a/synapse/server.py
+++ b/synapse/server.py
@@ -107,7 +107,11 @@ from synapse.handlers.stats import StatsHandler
 from synapse.handlers.sync import SyncHandler
 from synapse.handlers.typing import FollowerTypingHandler, TypingWriterHandler
 from synapse.handlers.user_directory import UserDirectoryHandler
-from synapse.http.client import InsecureInterceptableContextFactory, SimpleHttpClient
+from synapse.http.client import (
+    InsecureInterceptableContextFactory,
+    ReplicationClient,
+    SimpleHttpClient,
+)
 from synapse.http.matrixfederationclient import MatrixFederationHttpClient
 from synapse.media.media_repository import MediaRepository
 from synapse.metrics.common_usage_metrics import CommonUsageMetricsManager
@@ -472,6 +476,13 @@ class HomeServer(metaclass=abc.ABCMeta):
         return MatrixFederationHttpClient(self, tls_client_options_factory)
 
     @cache_in_self
+    def get_replication_client(self) -> ReplicationClient:
+        """
+        An HTTP client for HTTP replication.
+        """
+        return ReplicationClient(self)
+
+    @cache_in_self
     def get_room_creation_handler(self) -> RoomCreationHandler:
         return RoomCreationHandler(self)