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;








-1















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))









share|improve this question






























    -1















    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))









    share|improve this question


























      -1












      -1








      -1








      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))









      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      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






















          1 Answer
          1






          active

          oldest

          votes


















          2














          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.






          share|improve this answer























          • 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










          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
          );



          );













          draft saved

          draft discarded


















          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









          2














          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.






          share|improve this answer























          • 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















          2














          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.






          share|improve this answer























          • 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













          2












          2








          2







          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.






          share|improve this answer













          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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

















          • 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








          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.



















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

          Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?