Skip to content

Commit

Permalink
Support proxies in request() directly
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfies committed Jan 29, 2025
1 parent fde0ca1 commit 3387acc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions discord/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,9 +786,11 @@ async def request(
kwargs['headers'] = headers

# Proxy support
if self.proxy is not None:
proxy = kwargs.pop('proxy', self.proxy)
proxy = kwargs.pop('proxy_auth', self.proxy_auth)
if proxy is not None:
kwargs['proxies'] = {'all': self.proxy}
if self.proxy_auth is not None:
if proxy_auth is not None:
headers['Proxy-Authorization'] = self.proxy_auth.encode()

if not self._global_over.is_set():
Expand Down

0 comments on commit 3387acc

Please sign in to comment.