Skip to content

Commit 3387acc

Browse files
committed
Support proxies in request() directly
1 parent fde0ca1 commit 3387acc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

discord/http.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,9 +786,11 @@ async def request(
786786
kwargs['headers'] = headers
787787

788788
# Proxy support
789-
if self.proxy is not None:
789+
proxy = kwargs.pop('proxy', self.proxy)
790+
proxy = kwargs.pop('proxy_auth', self.proxy_auth)
791+
if proxy is not None:
790792
kwargs['proxies'] = {'all': self.proxy}
791-
if self.proxy_auth is not None:
793+
if proxy_auth is not None:
792794
headers['Proxy-Authorization'] = self.proxy_auth.encode()
793795

794796
if not self._global_over.is_set():

0 commit comments

Comments
 (0)