Started writing Telegram bot. Immediately I ran into a problem that I could not get an answer (apparently due to the blocking of the RKN)

I tried the proxy - it did not help - or something I did not set up ....

enter image description here

Are there any ways to bypass the lock and write Telegram bot?

  • It is not clear what language is written and what they tried to do. - Sheridan
  • You can configure vpn, there are free ones, they are configured quite simply, then all requests normally pass - Renat Azibaev

1 answer 1

To bypass blocking, you need to connect to SOCKS5 proxy:

/*** PHP CODE ***/ /****************/ $prxy = 'http://94.130.223.179:1080'; // адрСс:ΠΏΠΎΡ€Ρ‚ прокси $prxy_auth = 'auth_user:auth_pass'; // Π»ΠΎΠ³ΠΈΠ½:ΠΏΠ°Ρ€ΠΎΠ»ΡŒ для Π°ΡƒΡ‚Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ†ΠΈΠΈ /****************/ $ch = curl_init(); $url = "https://api.telegram.org/botXXXXX/sendMessage?chat_id=XXXXX&text=XXXXX"; // Π³Π΄Π΅ XXXXX - ваши значСния curl_setopt_array ($ch, array(CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true)); /********************* Код для ΠΏΠΎΠ΄ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΡ ΠΊ прокси *********************/ curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5); // Ρ‚ΠΈΠΏ прокси curl_setopt($ch, CURLOPT_PROXY, $prxy); // ip, port прокси curl_setopt($ch, CURLOPT_PROXYUSERPWD, $prxy_auth); // авторизация Π½Π° прокси curl_setopt($ch, CURLOPT_HEADER, false); // ΠΎΡ‚ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΠ΅ ΠΏΠ΅Ρ€Π΅Π΄Π°Ρ‡ΠΈ Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠΎΠ² Π² запросС curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Π²ΠΎΠ·Π²Ρ€Π°Ρ‚ Ρ€Π΅Π·ΡƒΠ»ΡŒΡ‚Π°Ρ‚Π° Π² качСствС строки curl_setopt($ch, CURLOPT_POST, 1); // использованиС простого HTTP POST curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // ΠΎΡ‚ΠΌΠ΅Π½Π° ΠΏΡ€ΠΎΠ²Π΅Ρ€ΠΊΠΈ сСртификата ΡƒΠ΄Π°Π»Π΅Π½Π½Ρ‹ΠΌ сСрвСром /***********************************************************************/ $result = curl_exec($ch); // DIGITAL RESISTANCE! curl_close($ch); 

Do not forget to substitute the working proxy address ($ prxy) and, if necessary, the data for authentication ($ prxy_auth), as well as your request ($ url)