How to use discord python bot with proxy?how to connect a discord bot through proxyHow do I check whether a file exists without exceptions?Calling an external command in PythonWhat are metaclasses in Python?Finding the index of an item given a list containing it in PythonDifference between proxy server and reverse proxy serverHow can I safely create a nested directory?Does Python have a ternary conditional operator?How to get the current time in PythonHow can I make a time delay in Python?Does Python have a string 'contains' substring method?
Do higher dimensions have axes?
How to extract interesting piece of output in bash
Why do jet engines sound louder on the ground than inside the aircraft?
How slow ( not zero) can a car engine run without hurting engine and saving on fuel
How was Luke's prosthetic hand in Episode V filmed?
Company looks for long-term employees, but I know I won't be interested in staying long
Do medium format lenses have a crop factor?
Proof that every field is perfect???
Who or what determines if a curse is valid or not?
Has sea level rise slowed down?
"Je suis petite, moi?", purpose of the "moi"?
How can I automate this tensor computation?
The most secure way to handle someone forgetting to verify their account?
Why do the digits of a number squared follow a similar quotient?
Why are there few or no black super GMs?
🍩🔔🔥Scrambled emoji tale⚛️🎶🛒 #2️⃣
Why does a tetrahedral molecule like methane have a dipole moment of zero?
/bin/sh: 0: Can't open sh
Why is the Intel 8086 CPU called a 16-bit CPU?
How can I help our ranger feel special about her beast companion?
Who determines when road center lines are solid or dashed?
Why do space operations use "nominal" to mean "working correctly"?
Pauli exclusion principle - black holes
Three Subway Escalators
How to use discord python bot with proxy?
how to connect a discord bot through proxyHow do I check whether a file exists without exceptions?Calling an external command in PythonWhat are metaclasses in Python?Finding the index of an item given a list containing it in PythonDifference between proxy server and reverse proxy serverHow can I safely create a nested directory?Does Python have a ternary conditional operator?How to get the current time in PythonHow can I make a time delay in Python?Does Python have a string 'contains' substring method?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Need to use discord bot with proxy (https or socks).
For example, proxy is: 192.168.1.1:3125 and proxy autorisation is: proxy_login:proxy_pass
I already try with this example: how to connect a discord bot through proxy but it can't.
client = discord.Client(proxy=USER_PROXY, proxy_auth=aiohttp.BasicAuth(USER_PROXY_LOGIN, USER_PROXY_PASS))
python proxy discord discord.py
add a comment |
Need to use discord bot with proxy (https or socks).
For example, proxy is: 192.168.1.1:3125 and proxy autorisation is: proxy_login:proxy_pass
I already try with this example: how to connect a discord bot through proxy but it can't.
client = discord.Client(proxy=USER_PROXY, proxy_auth=aiohttp.BasicAuth(USER_PROXY_LOGIN, USER_PROXY_PASS))
python proxy discord discord.py
add a comment |
Need to use discord bot with proxy (https or socks).
For example, proxy is: 192.168.1.1:3125 and proxy autorisation is: proxy_login:proxy_pass
I already try with this example: how to connect a discord bot through proxy but it can't.
client = discord.Client(proxy=USER_PROXY, proxy_auth=aiohttp.BasicAuth(USER_PROXY_LOGIN, USER_PROXY_PASS))
python proxy discord discord.py
Need to use discord bot with proxy (https or socks).
For example, proxy is: 192.168.1.1:3125 and proxy autorisation is: proxy_login:proxy_pass
I already try with this example: how to connect a discord bot through proxy but it can't.
client = discord.Client(proxy=USER_PROXY, proxy_auth=aiohttp.BasicAuth(USER_PROXY_LOGIN, USER_PROXY_PASS))
python proxy discord discord.py
python proxy discord discord.py
edited Mar 26 at 14:07
Patrick Haugh
34k10 gold badges35 silver badges52 bronze badges
34k10 gold badges35 silver badges52 bronze badges
asked Mar 26 at 10:51
Сергей ЖиренкинСергей Жиренкин
11 bronze badge
11 bronze badge
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You need to create a aiohttp.ProxyConnector
and pass that as the connector
to your Client
:
from aiohttp import ProxyConnector, BasicAuth
basic_auth = BasicAuth(USER_PROXY_LOGIN, USER_PROXY_PASS)
connector = ProxyConnector(USER_PROXY, proxy_auth=basic_auth)
cient = discord.Client(connector=connector)
As the question you linked notes, discord.py does not support HTTP proxies, only HTTPS proxies.
in aiohttp this code:def update_proxy(self, proxy, proxy_auth): if proxy and not proxy.startswith('http://'): raise ValueError("Only http proxies are supported") if proxy_auth and not isinstance(proxy_auth, helpers.BasicAuth): raise ValueError("proxy_auth must be None or BasicAuth() tuple") self.proxy = proxy self.proxy_auth = proxy_auth
so it doesn't work with https?
– Сергей Жиренкин
Mar 26 at 16:30
@СергейЖиренкин What version of discord.py and aiohttp are you using?
– Patrick Haugh
Mar 26 at 17:09
discord - 0.16.12 aiohttp - 1.0.5 python 3.6
– Сергей Жиренкин
Mar 26 at 17:50
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55355342%2fhow-to-use-discord-python-bot-with-proxy%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You need to create a aiohttp.ProxyConnector
and pass that as the connector
to your Client
:
from aiohttp import ProxyConnector, BasicAuth
basic_auth = BasicAuth(USER_PROXY_LOGIN, USER_PROXY_PASS)
connector = ProxyConnector(USER_PROXY, proxy_auth=basic_auth)
cient = discord.Client(connector=connector)
As the question you linked notes, discord.py does not support HTTP proxies, only HTTPS proxies.
in aiohttp this code:def update_proxy(self, proxy, proxy_auth): if proxy and not proxy.startswith('http://'): raise ValueError("Only http proxies are supported") if proxy_auth and not isinstance(proxy_auth, helpers.BasicAuth): raise ValueError("proxy_auth must be None or BasicAuth() tuple") self.proxy = proxy self.proxy_auth = proxy_auth
so it doesn't work with https?
– Сергей Жиренкин
Mar 26 at 16:30
@СергейЖиренкин What version of discord.py and aiohttp are you using?
– Patrick Haugh
Mar 26 at 17:09
discord - 0.16.12 aiohttp - 1.0.5 python 3.6
– Сергей Жиренкин
Mar 26 at 17:50
add a comment |
You need to create a aiohttp.ProxyConnector
and pass that as the connector
to your Client
:
from aiohttp import ProxyConnector, BasicAuth
basic_auth = BasicAuth(USER_PROXY_LOGIN, USER_PROXY_PASS)
connector = ProxyConnector(USER_PROXY, proxy_auth=basic_auth)
cient = discord.Client(connector=connector)
As the question you linked notes, discord.py does not support HTTP proxies, only HTTPS proxies.
in aiohttp this code:def update_proxy(self, proxy, proxy_auth): if proxy and not proxy.startswith('http://'): raise ValueError("Only http proxies are supported") if proxy_auth and not isinstance(proxy_auth, helpers.BasicAuth): raise ValueError("proxy_auth must be None or BasicAuth() tuple") self.proxy = proxy self.proxy_auth = proxy_auth
so it doesn't work with https?
– Сергей Жиренкин
Mar 26 at 16:30
@СергейЖиренкин What version of discord.py and aiohttp are you using?
– Patrick Haugh
Mar 26 at 17:09
discord - 0.16.12 aiohttp - 1.0.5 python 3.6
– Сергей Жиренкин
Mar 26 at 17:50
add a comment |
You need to create a aiohttp.ProxyConnector
and pass that as the connector
to your Client
:
from aiohttp import ProxyConnector, BasicAuth
basic_auth = BasicAuth(USER_PROXY_LOGIN, USER_PROXY_PASS)
connector = ProxyConnector(USER_PROXY, proxy_auth=basic_auth)
cient = discord.Client(connector=connector)
As the question you linked notes, discord.py does not support HTTP proxies, only HTTPS proxies.
You need to create a aiohttp.ProxyConnector
and pass that as the connector
to your Client
:
from aiohttp import ProxyConnector, BasicAuth
basic_auth = BasicAuth(USER_PROXY_LOGIN, USER_PROXY_PASS)
connector = ProxyConnector(USER_PROXY, proxy_auth=basic_auth)
cient = discord.Client(connector=connector)
As the question you linked notes, discord.py does not support HTTP proxies, only HTTPS proxies.
answered Mar 26 at 13:52
Patrick HaughPatrick Haugh
34k10 gold badges35 silver badges52 bronze badges
34k10 gold badges35 silver badges52 bronze badges
in aiohttp this code:def update_proxy(self, proxy, proxy_auth): if proxy and not proxy.startswith('http://'): raise ValueError("Only http proxies are supported") if proxy_auth and not isinstance(proxy_auth, helpers.BasicAuth): raise ValueError("proxy_auth must be None or BasicAuth() tuple") self.proxy = proxy self.proxy_auth = proxy_auth
so it doesn't work with https?
– Сергей Жиренкин
Mar 26 at 16:30
@СергейЖиренкин What version of discord.py and aiohttp are you using?
– Patrick Haugh
Mar 26 at 17:09
discord - 0.16.12 aiohttp - 1.0.5 python 3.6
– Сергей Жиренкин
Mar 26 at 17:50
add a comment |
in aiohttp this code:def update_proxy(self, proxy, proxy_auth): if proxy and not proxy.startswith('http://'): raise ValueError("Only http proxies are supported") if proxy_auth and not isinstance(proxy_auth, helpers.BasicAuth): raise ValueError("proxy_auth must be None or BasicAuth() tuple") self.proxy = proxy self.proxy_auth = proxy_auth
so it doesn't work with https?
– Сергей Жиренкин
Mar 26 at 16:30
@СергейЖиренкин What version of discord.py and aiohttp are you using?
– Patrick Haugh
Mar 26 at 17:09
discord - 0.16.12 aiohttp - 1.0.5 python 3.6
– Сергей Жиренкин
Mar 26 at 17:50
in aiohttp this code:
def update_proxy(self, proxy, proxy_auth): if proxy and not proxy.startswith('http://'): raise ValueError("Only http proxies are supported") if proxy_auth and not isinstance(proxy_auth, helpers.BasicAuth): raise ValueError("proxy_auth must be None or BasicAuth() tuple") self.proxy = proxy self.proxy_auth = proxy_auth
so it doesn't work with https?– Сергей Жиренкин
Mar 26 at 16:30
in aiohttp this code:
def update_proxy(self, proxy, proxy_auth): if proxy and not proxy.startswith('http://'): raise ValueError("Only http proxies are supported") if proxy_auth and not isinstance(proxy_auth, helpers.BasicAuth): raise ValueError("proxy_auth must be None or BasicAuth() tuple") self.proxy = proxy self.proxy_auth = proxy_auth
so it doesn't work with https?– Сергей Жиренкин
Mar 26 at 16:30
@СергейЖиренкин What version of discord.py and aiohttp are you using?
– Patrick Haugh
Mar 26 at 17:09
@СергейЖиренкин What version of discord.py and aiohttp are you using?
– Patrick Haugh
Mar 26 at 17:09
discord - 0.16.12 aiohttp - 1.0.5 python 3.6
– Сергей Жиренкин
Mar 26 at 17:50
discord - 0.16.12 aiohttp - 1.0.5 python 3.6
– Сергей Жиренкин
Mar 26 at 17:50
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55355342%2fhow-to-use-discord-python-bot-with-proxy%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown