This aiogram bot I made runs perfectly on my PC, but when I went to run it on their server, it gives me this error
aiogram.exceptions.TelegramNetworkError: HTTP Client says - ClientConnectorDNSError: Cannot connect to host api.telegram:4
43 ssl:default [getaddrinfo failed]
Now, understanding that they use a proxy, I checked it with this first
import aiohttp
import asyncio
async def test_proxy():
proxy_url = "http://172.16.2.11:8080"
async with aiohttp.ClientSession(proxy=proxy_url) as session:
async with session.get(";) as response:
print(await response.text())
asyncio.run(test_proxy())
and this works (i.e., returns HTML code).
Now, the problem is how do I configure my bot to connect to api.telegram
?
If you can give a small example of a bot configured with the above proxy and returns hello when "/start" is hit would be amazing.