-
Notifications
You must be signed in to change notification settings - Fork 474
Socks proxy support #355
Comments
Two questions:
Thank you, in any case. Don't worry about urllib3. I am happy for this feature to be asymmetrical, if I decide to include it at all. |
You can find my commit in q2: Newly added commit looks for application protocol in start of url, i.e. before q1: In |
Great idea to add socks proxy support @2i3r ! Please note that the package |
@das7pad really good points. Bests, |
Sorry, it was a mistake. |
Upstream PR: nibrag/aiosocks#27 I just read their setup in detail and we would drop support for |
Thank you @das7pad, really good point, I'm learning new stuff. I think it may be a big limitation, to drop support for In |
@das7pad and @2i3r, thanks for all the work and discussions. Supporting more types of proxies sounds like a good idea. However, as I overheard your conversations, something makes me uneasy. Should we make telepot depend on one more library just because we want to support one more type of proxies? What if someday someone comes up with an SSH tunneling proxy and telepot wants to support that, leading to dependence on an SSH library? How about a VPN proxy? Should telepot include a VPN library too? You get the idea ... Being a library solely for Telegram Bot API, telepot should depend on one thing only: HTTP libraries. Other communication requirements should fall on the application. Reviewing the module
This "Pluggable Connection Provider" architecture is not yet implemented by telepot. I will start to think about it. Hopefully it will be included in the near future. By that time, for some common types of non-HTTP proxies, e.g. SOCKS, their connection providers may be posted as examples to help others who share the same concerns. In conclusion, SOCKS proxy will not become part of telepot. I still want to thank @2i3r and @das7pad for prompting me to think of a better way 😊 |
But it's all about socks5 proxy. To connect via ssh tunneling proxy ( |
While
http
proxy works well in both traditional and async way of connections,socks
proxy is not available yet.I worked on and implemented Socks4/5 in async version by using
aiosocks
module,socks5
tested and seems to work. ready for pull request.usage is just the same as before, call
set_proxy
in start:telepot.aio.api.set_proxy("socks5://server.addr:port", ("username", "password"));
or
telepot.aio.api.set_proxy("socks4://server.addr:port", ("username"));
Not sure how to add similar support for urllib3.
Should I request a pull at this point?
Thank you for telepot.
The text was updated successfully, but these errors were encountered: