Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ########### requests example ########### #
- import requests
- pr = 'http://ehstnxnc-dest:[email protected]:80'
- proxies = {
- "http": pr,
- "https": pr
- }
- url = 'http://www.google.com'
- resp = requests.get(url=url, proxies=proxies)
- resp.ok
- True # output
- # ########### telethon example ########### #
- from telethon import TelegramClient
- import socks
- name = ...
- api_id = ...
- api_hash = ...
- proxy = (socks.HTTP, '45.72.30.159', 80, '8.8.8.8', 'ehstnxnc-dest', '4vefvq6n0s7w')
- c = TelegramClient(name, api_id, api_hash, proxy=proxy)
- c.loop.run_until_complete(c.connect())
- # ## Output ## #
- 2020-08-23 02:25:39,565 Connecting to 149.154.167.51:443/TcpFull...
- 2020-08-23 02:25:40,493 Attempt 1 at connecting failed: GeneralProxyError: Socket error: 407: Proxy Authentication Required
- 2020-08-23 02:25:40,493 Attempt 2 at connecting failed: GeneralProxyError: Socket error: 407: Proxy Authentication Required
- # ### Trying without rdns ### #
- proxy = (socks.HTTP, '45.72.30.159', 80, 'ehstnxnc-dest', '4vefvq6n0s7w')
- c = TelegramClient(name, api_id, api_hash, proxy=proxy)
- c.loop.run_until_complete(c.connect())
- # ## Output ## #
- 2020-08-23 02:27:35,261 Attempt 3 at connecting failed: GeneralProxyError: Socket error: 407: Proxy Authentication Required
- 2020-08-23 02:27:36,538 Attempt 4 at connecting failed: GeneralProxyError: Socket error: 407: Proxy Authentication Required
- 2020-08-23 02:27:37,816 Attempt 5 at connecting failed: GeneralProxyError: Socket error: 407: Proxy Authentication Required
Add Comment
Please, Sign In to add comment