Giter Site home page Giter Site logo

Comments (6)

mildsunrise avatar mildsunrise commented on August 13, 2024 2

Botgram currently doesn't support proxying. But apparently it wouldn't be very difficult to add, using this module. If you want to try it, npm install https-proxy-agent and then do the following modifications in server.js:

-var bot = botgram(config.authToken);
+var bot = botgram(config.authToken, { agent: new (require('https-proxy-agent'))(process.env.https_proxy) });

And the following in lib/wizard.js:

-        var bot = botgram(token);
+        var bot = botgram(token, { agent: new (require('https-proxy-agent'))(process.env.https_proxy) });

from shell-bot.

sebasolla avatar sebasolla commented on August 13, 2024

you are a genius!!
It works like a charm!

Thank you so much

from shell-bot.

mildsunrise avatar mildsunrise commented on August 13, 2024

Glad it worked :)
I'm reopening the issue, since I'd like to incorporate this into the code someday.

from shell-bot.

avissian avatar avissian commented on August 13, 2024

socks5 proxy:

var bot = botgram(config.authToken,
                 {agent: new (require('socks5-https-client/lib/Agent'))(
                   {"socksHost": "proxy_host",
                    "socksUsername": "user",
                    "socksPassword": "password",
                    "socksPort": 1080})
                  });

from shell-bot.

avissian avatar avissian commented on August 13, 2024

I'm reopening the issue, since I'd like to incorporate this into the code someday.

avissian@e4285be

from shell-bot.

mildsunrise avatar mildsunrise commented on August 13, 2024

It'd be ideal if the bot could inherit proxy settings from the https_proxy environment variable.
My code snippet works for http: and https: proxies, but not for SOCKS proxies... I'll try to merge everything when I have time.

from shell-bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.