I agree with Andrew here. IIRC, many years ago, Python had some rudimentary SOCKS support, but it was removed (probably because it was broken or didn't work reliably, and nobody volunteered to maintain it). So I'm not sure why asyncio should natively support SOCKS when the socket module doesn't support it.
I looked briefly into base_events._check_resolved_address(), and I don't see what you are claiming. AFAICT this function is only called directly by sock_connect(), and sock_connect() is only called by create_connection() when a host/port combination is given, not when it is given an already-connected socket. Do you have a test program showing that I am wrong? (It's possible -- the code in create_connection() is pretty complicated. But I don't think I am wrong.) --Guido On Thu, Jun 12, 2014 at 2:59 PM, Andrew Svetlov <[email protected]> wrote: > From my perspective SOCKS should be implemented in third-party library. > If the library need to install own DNS lookup -- that's ok. > Please take a look on https://code.google.com/p/tulip/issues/detail?id=160 > But personally I don't like to include SOCKS into asyncio itself. > > On Wed, Jun 11, 2014 at 3:01 AM, MaddinW1993 <[email protected]> wrote: > > Hello people, > > > > I ask for SOCKS proxy support to be included into asyncio. The goal > would be > > to route both DNS queries as well as actual network requests through the > > socks proxy listening on a local port. As of now, it appears to me that > it > > is forbiddingly difficult to do that through extending asyncio and not > > replacing great parts of the underlying code. DNS lookups are being > cached > > and open on a regular socket regardless, even when a socket which was > > already connected to the SOCKS was passed to the loop.create_connection > > method. If a user minds his privacy and uses tor, this is likely against > his > > will as an adversary could learn about visited sites that way. The only > > possibility I could find is by monkeypatching the > > base_events._check_already_resolved method, and I think think there > should > > be a more beautiful way to do this in Python. > > > > Thank you for your consideration. > > > > > > > > -- > Thanks, > Andrew Svetlov > -- --Guido van Rossum (python.org/~guido)
