mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 05:18:10 +00:00
Update Proxy page
This commit is contained in:
parent
2c917fa9ae
commit
03916a4792
@ -7,44 +7,44 @@ through an intermediate SOCKS5 proxy server.
|
||||
Usage
|
||||
-----
|
||||
|
||||
To use Pyrogram with a proxy, simply append the following to your ``config.ini`` file and replace the values
|
||||
with your own settings:
|
||||
- To use Pyrogram with a proxy, simply append the following to your ``config.ini`` file and replace the values
|
||||
with your own settings:
|
||||
|
||||
.. code-block:: ini
|
||||
.. code-block:: ini
|
||||
|
||||
[proxy]
|
||||
enabled = True
|
||||
hostname = 11.22.33.44
|
||||
port = 1080
|
||||
username = <your_username>
|
||||
password = <your_password>
|
||||
[proxy]
|
||||
enabled = True
|
||||
hostname = 11.22.33.44
|
||||
port = 1080
|
||||
username = <your_username>
|
||||
password = <your_password>
|
||||
|
||||
- To enable or disable the proxy without deleting your settings from the config file,
|
||||
change the ``enabled`` value as follows:
|
||||
- To enable or disable the proxy without deleting your settings from the config file,
|
||||
change the ``enabled`` value as follows:
|
||||
|
||||
- ``1``, ``yes``, ``True`` or ``on``: Enables the proxy
|
||||
- ``0``, ``no``, ``False`` or ``off``: Disables the proxy
|
||||
- ``1``, ``yes``, ``True`` or ``on``: Enables the proxy
|
||||
- ``0``, ``no``, ``False`` or ``off``: Disables the proxy
|
||||
|
||||
Alternatively, you can setup your proxy without the need of the *config.ini* file by using the *proxy* parameter
|
||||
in the Client class:
|
||||
- Alternatively, you can setup your proxy without the need of the *config.ini* file by using the *proxy* parameter
|
||||
in the Client class:
|
||||
|
||||
.. code-block:: python
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrogram import Client
|
||||
|
||||
client = Client(
|
||||
session_name="example",
|
||||
proxy=dict(
|
||||
hostname="11.22.33.44",
|
||||
port=1080,
|
||||
username="<your_username>",
|
||||
password="<your_password>"
|
||||
)
|
||||
)
|
||||
client = Client(
|
||||
session_name="example",
|
||||
proxy=dict(
|
||||
hostname="11.22.33.44",
|
||||
port=1080,
|
||||
username="<your_username>",
|
||||
password="<your_password>"
|
||||
)
|
||||
)
|
||||
|
||||
client.start()
|
||||
client.start()
|
||||
|
||||
...
|
||||
...
|
||||
|
||||
.. note:: If your proxy doesn't require authorization you can omit *username* and *password* by either leaving the
|
||||
values blank/empty or completely delete the lines.
|
Loading…
x
Reference in New Issue
Block a user