discord.py icon indicating copy to clipboard operation
discord.py copied to clipboard

Add proxy variable

Open jhqwqmc opened this issue 1 year ago • 7 comments

Summary

Add the use of the proxy variable to the from_url function of the webhook class.

During use, I found that the from_url function did not provide a proxy parameter to pass in. My area requires a proxy to access discord, so I added this parameter.

Checklist

  • [x] If code changes were made then they have been tested.
    • [ ] I have updated the documentation to reflect the changes.
  • [ ] This PR fixes an issue.
  • [x] This PR adds something new (e.g. new method or parameters).
  • [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • [ ] This PR is not a code change (e.g. documentation, README, ...)

jhqwqmc avatar Feb 22 '24 19:02 jhqwqmc

If you were to ask me, this isn't needed. I would wonder why even support proxies for webhooks?

No767 avatar Feb 22 '24 19:02 No767

The reason for this is because you can set the proxies on the ClientSession you create instead.

Rapptz avatar Feb 22 '24 19:02 Rapptz

ClientSession does not provide proxy variables. You need to pass proxy variables to Webhook.

jhqwqmc avatar Feb 22 '24 20:02 jhqwqmc

Needing a proxy is also a helpless move. Our country has blocked the website discord.com.

jhqwqmc avatar Feb 22 '24 20:02 jhqwqmc

Actually it seems you're right, I forgot this change happened to aiohttp a while back. This PR is insufficient though. It needs to support proxy_auth parameter as well and be properly documented.

Rapptz avatar Feb 22 '24 20:02 Rapptz

I just added proxy_auth

jhqwqmc avatar Feb 22 '24 20:02 jhqwqmc

This is still missing documentation, and most likely needs to run black.

Rapptz avatar Feb 22 '24 20:02 Rapptz