2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-23 10:28:00 +00:00

36 lines
824 B
ReStructuredText
Raw Normal View History

Proxy Settings
==============
2018-01-18 13:23:05 +01:00
2018-02-08 17:04:10 +01:00
Pyrogram supports proxies with and without authentication. This feature allows Pyrogram to exchange data with Telegram
through an intermediate SOCKS 4/5 or HTTP (CONNECT) proxy server.
2018-01-18 13:23:05 +01:00
2020-04-01 20:08:46 +02:00
.. contents:: Contents
:backlinks: none
:depth: 1
2020-04-01 20:08:46 +02:00
:local:
-----
2018-01-18 13:23:05 +01:00
Usage
-----
To use Pyrogram with a proxy, use the *proxy* parameter in the Client class. If your proxy doesn't require authorization
you can omit ``username`` and ``password``.
2018-01-18 13:23:05 +01:00
.. code-block:: python
2018-01-18 13:23:05 +01:00
from pyrogram import Client
2018-01-18 13:23:05 +01:00
app = Client(
"my_account",
proxy=dict(
scheme="socks5", # "socks4", "socks5" and "http" are supported
hostname="11.22.33.44",
port=1234,
username="<your_username>",
password="<your_password>"
2018-02-27 18:18:25 +01:00
)
)
2018-02-22 11:02:38 +01:00
app.run()