mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 21:10:29 +00:00
Allow using lists and dicts for passing proxy settings
This commit is contained in:

committed by
Lonami

parent
3de398bae6
commit
5362f2578d
@@ -25,7 +25,10 @@ class TcpClient:
|
||||
else:
|
||||
import socks
|
||||
self._socket = socks.socksocket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
self._socket.set_proxy(*self._proxy)
|
||||
if type(self._proxy) is dict:
|
||||
self._socket.set_proxy(**self._proxy)
|
||||
else: # tuple, list, etc.
|
||||
self._socket.set_proxy(*self._proxy)
|
||||
|
||||
def connect(self, ip, port):
|
||||
"""Connects to the specified IP and port number"""
|
||||
|
Reference in New Issue
Block a user