diff options
| author | PapyrusThePlant <[email protected]> | 2017-08-11 16:44:15 +0200 |
|---|---|---|
| committer | PapyrusThePlant <[email protected]> | 2017-08-11 16:44:15 +0200 |
| commit | 0d21e83b7f008e10ba6507af659d1207eb94263f (patch) | |
| tree | ba36c09975e982abbebaa1e2aaad47f32b02798d /discord/client.py | |
| parent | [commands] Ensure no mentions escape clean_content (diff) | |
| download | discord.py-0d21e83b7f008e10ba6507af659d1207eb94263f.tar.xz discord.py-0d21e83b7f008e10ba6507af659d1207eb94263f.zip | |
Fix the proxy support for aiohttp>=1.4.
Diffstat (limited to 'discord/client.py')
| -rw-r--r-- | discord/client.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/discord/client.py b/discord/client.py index a310c3de..f21417c3 100644 --- a/discord/client.py +++ b/discord/client.py @@ -80,8 +80,11 @@ class Client: The `event loop`_ to use for asynchronous operations. Defaults to ``None``, in which case the default event loop is used via ``asyncio.get_event_loop()``. connector : aiohttp.BaseConnector - The `connector`_ to use for connection pooling. Useful for proxies, e.g. - with a `ProxyConnector`_. + The `connector`_ to use for connection pooling. + proxy : Optional[str] + Proxy URL. + proxy_auth : Optional[aiohttp.BasicAuth] + An object that represents proxy HTTP Basic Authorization. shard_id : Optional[int] Integer starting at 0 and less than shard_count. shard_count : Optional[int] @@ -116,7 +119,9 @@ class Client: self.shard_count = options.get('shard_count') connector = options.pop('connector', None) - self.http = HTTPClient(connector, loop=self.loop) + proxy = options.pop('proxy', None) + proxy_auth = options.pop('proxy_auth', None) + self.http = HTTPClient(connector, proxy=proxy, proxy_auth=proxy_auth, loop=self.loop) self._connection = ConnectionState(dispatch=self.dispatch, chunker=self._chunker, syncer=self._syncer, http=self.http, loop=self.loop, **options) |