Forums

Ошибка при попытке запуска на сервере aiogram проекта

raise exceptions.NetworkError(f"aiohttp client throws an error: {e.class.name}: {e}") aiogram.utils.exceptions.NetworkError: Aiohttp client throws an error: ClientConnectorError: Cannot connect to host api.telegram. org:443 ss1:default [Network is unreachable]

Free accounts on PythonAnywhere have restricted Internet access, which means that they have to access external sites using a proxy server. You'll need to configure your code so that it tells aiogram to use that proxy -- check out the library's documentation to find out how to do that. The values for the proxy (hostname and port) can be found by running this Bash command:

echo $http_proxy