From 914c091b7e9b24432a84db54885d648a1dfd304f Mon Sep 17 00:00:00 2001 From: Lonami Date: Sun, 10 Sep 2017 15:55:14 +0200 Subject: [PATCH] Mention how to use a proxy --- Getting-Started.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Getting-Started.md b/Getting-Started.md index d3e7c8a..8fa75b8 100644 --- a/Getting-Started.md +++ b/Getting-Started.md @@ -3,3 +3,15 @@ * [Sending Requests](Sending-Requests) * [Working with Updates](Working-with-Updates) * [Accessing the Full API](Accessing-the-Full-API) + +If you want to use a **proxy**, you have to [install PySocks](https://github.com/Anorov/PySocks#installation) (via pip or manual) and then set the appropriated parameters: + +```python +import socks +client = TelegramClient('session_id', + api_id=12345, api_hash='0123456789abcdef0123456789abcdef', + proxy=(socks.SOCKS5, 'localhost', 4444) +) +``` + +The `proxy=` argument should be a `tuple`, a `list` or a `dict`, consisting of parameters described [here](https://github.com/Anorov/PySocks#usage-1>).