Closed ilya-fedin closed 6 years ago
Do you know what is needed for that as I haven't played with SOCKS proxy's as yet and don't have an setup available to play with anyways. A pull request is always welcome in case somebody know what to do here.
Jos
Can you add support for at least HTTP proxy? SOCKS proxy can be wrapped in HTTP via polipo/privoxy.
My answer is the same as I don't see the difference really between an http and socks proxy. The dtgbot.lua script is using these libraries:
-- Load necessary Lua libraries
http = require "socket.http";
socket = require "socket";
https = require "ssl.https";
.. and we are using https.request() to get the data from telegram, so simply open dtgbot.lua and have a play with that commandline :
response, status = https.request(telegram_url..'getUpdates?timeout=60&offset='..TelegramBotOffset)
.. and see whether you can modify it to your needs.
Jos
Ok, thank you.
... and ? Have you been able to see whether it can be adapted to support Proxy's?
Google says that ssl.https can't make requests through a proxy, it is possible through curl bindings to do. But I'm not a lua programmer, so I just installed majordomo - its bot can work through a proxy.
This is necessary to work in countries where Telegram is blocked