G
G
galtim112020-05-08 00:52:03
Python
galtim11, 2020-05-08 00:52:03

How to run a bot in python from behind a proxy?

I've been trying to connect a proxy to a completely simple bot for two days now, but it doesn't work!!
Gives an error after launch

ERROR - TeleBot: "SSLError occurred, args=(SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)'),),)

the code itself is here:
import telebot

bot = telebot.TeleBot('1190811079:AAEui3GQq1yJOk8pivrcjA8cVMIFBi1lI0A')

@bot.message_handler(content_types=['text'])
def lalala(message):
    bot.send_message(message.chat.id, message.text)

bot.polling(none_stop=True)

You need to connect a proxy.
Thank you very much for your help!!!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Neverov, 2020-05-08
@TTATPuOT

You are not connecting to any proxy, but making requests directly, judging by your code.
And you don't need a proxy. For development, use a VPN, and select a server immediately without blocking.
Here is a list where you can host bots today in Russia: https://code.patriotovsky.ru/na-kakih-hostingah-v-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question