summary refs log tree commit diff
path: root/synapse/server.pyi
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2019-11-01 14:07:44 +0000
committerRichard van der Hoff <richard@matrix.org>2019-11-01 14:22:46 +0000
commit85f15ac59246b3fdbb914ca47b9f7c47d76a3b6b (patch)
tree909d8c7ca7b07f6e4e4fad081fadb1cc62f6d171 /synapse/server.pyi
parentMerge pull request #9 from matrix-org/babolivier/ci (diff)
downloadsynapse-85f15ac59246b3fdbb914ca47b9f7c47d76a3b6b.tar.xz
Support for routing outbound HTTP requests via a proxy (#6239)
The `http_proxy` and `HTTPS_PROXY` env vars can be set to a `host[:port]` value which should point to a proxy.

The address of the proxy should be excluded from IP blacklists such as the `url_preview_ip_range_blacklist`.

The proxy will then be used for
 * push
 * url previews
 * phone-home stats
 * recaptcha validation
 * CAS auth validation

It will *not* be used for:
 * Application Services
 * Identity servers
 * Outbound federation
 * In worker configurations, connections from workers to masters

Fixes #4198.
Diffstat (limited to 'synapse/server.pyi')
-rw-r--r--synapse/server.pyi10
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/server.pyi b/synapse/server.pyi
index 9583e82d52..69263458db 100644
--- a/synapse/server.pyi
+++ b/synapse/server.pyi
@@ -12,6 +12,7 @@ import synapse.handlers.message
 import synapse.handlers.room
 import synapse.handlers.room_member
 import synapse.handlers.set_password
+import synapse.http.client
 import synapse.rest.media.v1.media_repository
 import synapse.server_notices.server_notices_manager
 import synapse.server_notices.server_notices_sender
@@ -46,7 +47,14 @@ class HomeServer(object):
 
     def get_state_resolution_handler(self) -> synapse.state.StateResolutionHandler:
         pass
-
+    def get_simple_http_client(self) -> synapse.http.client.SimpleHttpClient:
+        """Fetch an HTTP client implementation which doesn't do any blacklisting
+        or support any HTTP_PROXY settings"""
+        pass
+    def get_proxied_http_client(self) -> synapse.http.client.SimpleHttpClient:
+        """Fetch an HTTP client implementation which doesn't do any blacklisting
+        but does support HTTP_PROXY settings"""
+        pass
     def get_deactivate_account_handler(self) -> synapse.handlers.deactivate_account.DeactivateAccountHandler:
         pass