progval / Limnoria

A robust, full-featured, and user/programmer-friendly Python IRC bot, with many existing plugins.
https://docs.limnoria.net/
Other
623 stars 173 forks source link

Support SOCKS proxy for HTTP traffic #1347

Open Mikaela opened 6 years ago

Mikaela commented 6 years ago

I am curious in putting HTTP traffic through Tor network and it only supports socks proxy. However I cannot as supybot.protocols.http.proxy is the option used for HTTP traffic such as Web title/fetch and only takes HTTP proxy and the other configs appear to be IRC network-specific.

I next thought of setting up a local HTTP proxy, but the options appear to be Polipo that hasn't been maintained since at least 2016 or Privoxy which had the latest update at SourceForge in January 2017. This doesn't encourage me to set up either and I thought that maybe I should open an issue to Limnoria.

<urlopen error Tunnel connection failed: 501 Tor is not an HTTP Proxy>

The current (running) version of this Limnoria is 2018.09.09, running on Python 3.6.5 (default, Apr 1 2018, 05:46:30) [GCC 7.3.0]. The newest versions available online are 2018.09.09 (in master), 2018.09.16 (in testing).

Hasimir commented 6 years ago

privoxy is fine if it only listens on localhost; it simply provides a means (natively to the proxy server) to direct HTTP traffic through the built-in Tor SOCKS proxy. The only alternative to that, really, is to roll your own. No doubt it can be done with Twisted or asyncio, maybe even with requests but it'd be annoying and time consuming.

Mikaela commented 6 years ago

The only alternative to that, really, is to roll your own. No doubt it can be done with Twisted or asyncio, maybe even with requests but it'd be annoying and time consuming.

Does this mean that it's very different from supybot.networks.NETWORK.socksproxy or what makes it annoying and time consuming? I see PySocks in requirements.txt and Googling requests seems to support socks proxies (Advanced use socks), but I imagine adding depedencies isn't desirable.

Mikaela commented 3 years ago

Tor has since gotten the option HTTPTunnelPort or if it existed back in 2018, I didn't know of it, but that has separate issue of https://github.com/ProgVal/Limnoria/issues/1349.

I still see this as a valid issue for cases like Mullvad socks5 proxy though.