Skip to content
Ilya Ableev edited this page Apr 17, 2018 · 10 revisions

If you want to use socks5 proxy

How to test proxy server:

curl -IL --socks5 host:port --proxy-user username:password https://api.telegram.org

WARNING: if you are using public "socks5 proxy server for Telegram" it might not work!!!

Preparation:

  1. Update the script (zbxtg.py) to the latest revision
  2. update pip: sudo pip install --upgrade pip
  3. update requests: sudo pip install requests --upgrade (right now working version is 2.18.4)
  4. install pysocks: sudo pip install pysocks

Make sure that everything is ok:

$ sudo pip freeze | grep -iE 'sock|req'
PySocks==1.6.8
requests==2.18.4
requests-oauthlib==0.6.2
requests-toolbelt==0.8.0

Settings in zbxtg_settings.py:

  1. if you are using socks5 proxy with username and password proxy_to_tg = "socks5://username:password@host:port"

  2. if you are using socks5 proxy without username and password proxy_to_tg = "socks5://host:port"

  3. http/https proxy (such as squid) should be working as before