Add General.proxy setting, supports HTTP & SOCKS5

This commit is contained in:
miruka
2021-03-02 12:11:54 -04:00
parent b0d31af3c0
commit f6f0a0c1ee
5 changed files with 44 additions and 1 deletions

View File

@@ -540,7 +540,8 @@ class Backend:
# We just want that client's aiohttp session, that way we don't have
# to depend ourselves on aiohttp + aiohttp-socks
client = nio.AsyncClient(homeserver="")
proxy = self.settings.General.proxy
client = nio.AsyncClient(homeserver="", proxy=proxy)
await have_session_be_created(client)
session = type(client.client_session)(