mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-28 23:20:09 +03:00
IPv6 support for endpoint.py
Similar to https://github.com/matrix-org/synapse/pull/1689, but for endpoint.py
This commit is contained in:
parent
6e18805ac2
commit
9f07f4c559
1 changed files with 4 additions and 4 deletions
|
@ -13,7 +13,7 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from twisted.internet.endpoints import SSL4ClientEndpoint, TCP4ClientEndpoint
|
from twisted.internet.endpoints import HostnameEndpoint, wrapClientTLS
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
from twisted.internet.error import ConnectError
|
from twisted.internet.error import ConnectError
|
||||||
from twisted.names import client, dns
|
from twisted.names import client, dns
|
||||||
|
@ -58,11 +58,11 @@ def matrix_federation_endpoint(reactor, destination, ssl_context_factory=None,
|
||||||
endpoint_kw_args.update(timeout=timeout)
|
endpoint_kw_args.update(timeout=timeout)
|
||||||
|
|
||||||
if ssl_context_factory is None:
|
if ssl_context_factory is None:
|
||||||
transport_endpoint = TCP4ClientEndpoint
|
transport_endpoint = HostnameEndpoint
|
||||||
default_port = 8008
|
default_port = 8008
|
||||||
else:
|
else:
|
||||||
transport_endpoint = SSL4ClientEndpoint
|
def transport_endpoint(reactor, host, port):
|
||||||
endpoint_kw_args.update(sslContextFactory=ssl_context_factory)
|
return wrapClientTLS(ssl_context_factory, HostnameEndpoint(reactor, host, port))
|
||||||
default_port = 8448
|
default_port = 8448
|
||||||
|
|
||||||
if port is None:
|
if port is None:
|
||||||
|
|
Loading…
Reference in a new issue