1 parent 56748ff commit c9469edCopy full SHA for c9469ed
1 file changed
pyrogram/session/auth.py
@@ -26,7 +26,7 @@
26
from pyrogram.api.core import Object, Long, Int
27
from pyrogram.connection import Connection
28
from pyrogram.crypto import AES, RSA, Prime
29
-from .internals import MsgId, DataCenter
+from .internals import MsgId
30
31
log = logging.getLogger(__name__)
32
@@ -46,9 +46,10 @@ class Auth:
46
16
47
)
48
49
- def __init__(self, dc_id: int, test_mode: bool, proxy: dict):
+ def __init__(self, dc_id: int, test_mode: bool, ipv6: bool, proxy: dict):
50
self.dc_id = dc_id
51
self.test_mode = test_mode
52
+ self.ipv6 = ipv6
53
self.proxy = proxy
54
55
self.connection = None
@@ -84,7 +85,7 @@ def create(self):
84
85
# The server may close the connection at any time, causing the auth key creation to fail.
86
# If that happens, just try again up to MAX_RETRIES times.
87
while True:
- self.connection = Connection(DataCenter(self.dc_id, self.test_mode), self.proxy)
88
+ self.connection = Connection(self.dc_id, self.test_mode, self.ipv6, self.proxy)
89
90
try:
91
log.info("Start creating a new auth key on DC{}".format(self.dc_id))
0 commit comments