KurimuzonAkuma / pyrogram

Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots
https://pyrogram.org
GNU Lesser General Public License v3.0
358 stars 96 forks source link

Add "Proxy" Type for Proxy Settings #98

Open nimaxin opened 1 month ago

nimaxin commented 1 month ago

Checklist

Description

Currently, the Client.proxy parameter only takes a dict, which can be confusing. I suggest adding a Proxy type and ProxyScheme enum to improve clarity and make the available parameters and schemes explicit.

Example usage:

Client(
    proxy=Proxy(
        scheme=ProxyScheme.HTTP,
        hostname="127.0.0.1",
        port=12345,
        username="username",
        password="password",
    ),
)

I’m happy to submit a PR to implement this feature. Let me know if you're open to it.