Rewrite gateway to use aiohttp instead of websockets

This commit is contained in:
Rapptz
2020-04-07 21:53:55 -04:00
parent 45cb231161
commit b8154e365f
8 changed files with 97 additions and 92 deletions

View File

@ -111,6 +111,17 @@ class HTTPClient:
if self.__session.closed:
self.__session = aiohttp.ClientSession(connector=self.connector)
async def ws_connect(self, url):
kwargs = {
'proxy_auth': self.proxy_auth,
'proxy': self.proxy,
'max_msg_size': 0,
'timeout': 30.0,
'autoclose': False,
}
return await self.__session.ws_connect(url, **kwargs)
async def request(self, route, *, files=None, **kwargs):
bucket = route.bucket
method = route.method