From b1431b6fa7b00957c4a1cc00cbc1f33787cfb14d Mon Sep 17 00:00:00 2001 From: Alexander Bersenev Date: Wed, 6 Jun 2018 18:25:55 +0500 Subject: [PATCH] use ProactorEventLoop on Windows OS --- mtprotoproxy.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mtprotoproxy.py b/mtprotoproxy.py index 761504f..d02fbb8 100755 --- a/mtprotoproxy.py +++ b/mtprotoproxy.py @@ -9,6 +9,7 @@ import time import hashlib import random import binascii +import sys try: from Crypto.Cipher import AES @@ -733,6 +734,10 @@ def print_tg_info(): def main(): init_stats() + if sys.platform == 'win32': + loop = asyncio.ProactorEventLoop() + asyncio.set_event_loop(loop) + loop = asyncio.get_event_loop() stats_printer_task = asyncio.Task(stats_printer()) asyncio.ensure_future(stats_printer_task)