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

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript