aboutsummaryrefslogtreecommitdiff
path: root/discord/http.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2020-04-07 21:53:55 -0400
committerRapptz <[email protected]>2020-07-25 09:59:38 -0400
commitb8154e365ff584438a8d42354e56881e550bb72e (patch)
tree799c9bb73c25731a87cb12c04a35b420260f8970 /discord/http.py
parentFix AttributeError on reconnection (diff)
downloaddiscord.py-b8154e365ff584438a8d42354e56881e550bb72e.tar.xz
discord.py-b8154e365ff584438a8d42354e56881e550bb72e.zip
Rewrite gateway to use aiohttp instead of websockets
Diffstat (limited to 'discord/http.py')
-rw-r--r--discord/http.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/discord/http.py b/discord/http.py
index 39fcaed0..a9da4267 100644
--- a/discord/http.py
+++ b/discord/http.py
@@ -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