Add proxy support using PySocks (closes #37)

This commit is contained in:
Epix Zhang
2017-03-21 00:16:34 +08:00
committed by Lonami
parent b4c81a60b3
commit 350c11d66f
5 changed files with 35 additions and 8 deletions

View File

@@ -7,8 +7,8 @@ from telethon.utils import BinaryWriter
class TcpTransport:
def __init__(self, ip_address, port):
self.tcp_client = TcpClient()
def __init__(self, ip_address, port, proxy=None):
self.tcp_client = TcpClient(proxy)
self.send_counter = 0
self.tcp_client.connect(ip_address, port)