summary refs log tree commit diff
path: root/synapse/http/outbound_federation_proxy.py
blob: 1f3ed0c884239e6d8cc99611b6c846d02f94ab2b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from twisted.web.http import HTTPFactory
from twisted.web.proxy import Proxy, ProxyClient, ProxyClientFactory, ProxyRequest


class FederationOutboundProxyClient(ProxyClient):
    ...


class FederationOutboundProxyClientFactory(ProxyClientFactory):
    protocol = FederationOutboundProxyClient


class FederationOutboundProxyRequest(ProxyRequest):
    protocols = {b"matrix": FederationOutboundProxyClientFactory}
    ports = {b"matrix": 80}


class FederationOutboundProxy(Proxy):
    requestFactory = FederationOutboundProxyRequest


OutboundFederationProxyFactory = HTTPFactory.forProtocol(FederationOutboundProxy)