Forums

Problem with aiogram 3

Hello everyone, I'm facing a problem

ClientConnectorError: Cannot connect to host api.airforce:443 ssl:default [None]
Traceback (most recent call last):
 File "/home/asyncio/.local/lib/python3.10/site-packages/aiohttp/connector.py", line 1115, in _wrap_create_connection
 sock = await aiohappyeyeballs.start_connection(
 File "/home/asyncio/.local/lib/python3.10/site-packages/aiohappyeyeballs/impl.py", line 131, in start_connection
 raise OSError(msg)
OSError: Multiple exceptions: [Errno 111] Connect call failed ('104.26.15.221', 443), [Errno 101] Network is unreachable

This problem occurs on pythonanywhere, on PC everything is fine.

[edit by admin: formatting]

It looks like the package you're using is trying to connect directly to Telegram rather than using the proxy that free accounts have to use to access the external Internet. You'll need to check out the documentation for aiogram to find out how to make it use a proxy -- you can find the proxy details to provide if you run echo $http_proxy in a Bash console.