My server exposes two IPs. How to create two Telethon clients so that clientA use IP1 and clientB uses IP2? Is it even possible without fiddling Telegram code? And if not, what's the reason?
My server exposes two IPs. How to create two Telethon clients so that clientA use IP1 and clientB uses IP2? Is it even possible without fiddling Telegram code? And if not, what's the reason?
The TelegramClient constructor has a local_addr argument that allows you to specify which address the client should use to send requests from:
local_addr (str | tuple, optional):
Local host address (and port, optionally) used to bind the socket to locally. You only need to use this if you have multiple network cards and want to use a specific one.