Python / Telegram SDK · SOCKS5 (:1080)
How to Use VexHop Proxies with Python & Telethon
Bind every Telethon or Pyrogram client session to a dedicated Hard-Pin residential or ISP IP over SOCKS5 on port 1080.
python-socks / PySocks tuple on port 1080
import os
import socks
from telethon import TelegramClient
proxy = (
socks.SOCKS5,
'proxy.vexhop.com',
1080,
True,
'u_acc01-pool-residential-c-de-hs-tg0001',
os.environ['VEXHOP_PROXY_SECRET'],
)
client = TelegramClient('session_tg0001', api_id, api_hash, proxy=proxy)
client.start()
Step-by-Step Setup
-
1
Install PySocks or python-socks
Install Telethon's SOCKS5 dependency via pip install telethon pysocks python-socks.
-
2
Assign a unique Hard-Pin slot per session
Use -hs-<account_id> (e.g. -hs-tg0001) so each Telegram .session file always routes through its own persistent session.
-
3
Enable remote DNS (rdns=True)
Pass True as the fourth element of the SOCKS5 tuple so DNS resolution happens remotely via the gateway.
-
4
Connect and monitor balance
Start your TelegramClient; VexHop keeps long-lived TCP sockets alive and reports live usage in your dashboard.
Popular Locations & Related Utilities
Python & Telethon FAQ
Which pool is best for Telethon bots and userbots?
Residential (1x) with Hard-Pin (-hs-slot) is the most cost-effective choice for large fleets; Mobile 4G/5G (3x) gives carrier-grade CGNAT trust for sensitive signups.