Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webhooks don't use the proxy #1152

Open
3 tasks done
alentoghostflame opened this issue Dec 5, 2023 · 0 comments
Open
3 tasks done

Webhooks don't use the proxy #1152

alentoghostflame opened this issue Dec 5, 2023 · 0 comments
Labels
t: unconfirmed bug Type: bug - needs testing on if this is an issue

Comments

@alentoghostflame
Copy link
Collaborator

alentoghostflame commented Dec 5, 2023

Summary

When proxy parameters are passed into Client/Bot, they are correctly relayed to HTTPClient and all requests done via HTTPClient (including the websocket connection) use the given proxy parameters correctly.
Webhooks are never given the proxy parameters and never attempt to use them.

Reproduction Steps

  1. Pass proxy and proxy_auth into commands.Bot
  2. Receive an incoming interaction
  3. Attempt to respond via interaction.send

Minimal Reproducible Code

# Taken from a help thread in the Nextcord Discord, https://discord.com/channels/881118111967883295/1181655083306467473

PROXY = os.environ.get('https_proxy')

parsed_proxy = urlparse(PROXY)
proxy_url = f"{parsed_proxy.scheme}://{parsed_proxy.hostname}:{parsed_proxy.port}"
proxy_auth = BasicAuth(parsed_proxy.username, parsed_proxy.password)
bot = commands.Bot(description=description, intents=intents, proxy=proxy_url, proxy_auth=proxy_auth)

# in a slash command
await interaction.send("xyz")

Expected Results

The bot responds to the interaction correctly.

Actual Results

The bot doesn't respond to the interaction.

Intents

members, message_content

System Information

  • Python v3.11.6-final
  • nextcord v2.6.0-final
  • aiohttp v3.9.1
  • system info: Linux 6.6.3 Adapting to the new name #1-NixOS SMP PREEMPT_DYNAMIC Tue Nov 28 17:20:18 UTC 2023

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

I made this on the behalf of a Discord user. This was reported in the Nextcord Discord server, https://discord.com/channels/881118111967883295/1181655083306467473

@alentoghostflame alentoghostflame added the t: unconfirmed bug Type: bug - needs testing on if this is an issue label Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t: unconfirmed bug Type: bug - needs testing on if this is an issue
Projects
None yet
Development

No branches or pull requests

1 participant