Opened 9 years ago

Closed 9 years ago

#3920 enhancement closed duplicate (duplicate)

Socks4a now with Asynchronous hostname resolution

Reported by: lorph Owned by:
Priority: normal Milestone:
Component: core Keywords: socks protocols
Cc: khorn, Thijs Triemstra Branch:
Author: lorph


A short while ago I implemented the socks4a feature. It used a blocking gethostbyname to resolve hostnames which was a fast and easy update.

With this new slightly longer fix, the gethostbyname is replaced with reactor.resolve so it will not be blocking anymore. I have also updated the unit with help from Exarkun.

If you would like an easy way to test it on Firefox, here is how to do it.

Run this code:

from twisted.internet import reactor
from twisted.protocols.socks import SOCKSv4Factory

class SOCKSFactory(SOCKSv4Factory):
    def __init__(self):
        SOCKSv4Factory.__init__(self, '')
reactor.listenTCP(1080, SOCKSFactory())

In Firefox, go to "about:config" and set "network.proxy.socks_remote_dns" to true. Then set the Firefox socks proxy to localhost:1080. This is also used in other programs such as utorrent.

Attachments (1)

socks4a.diff (8.0 KB) - added by lorph 9 years ago.

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by lorph

Attachment: socks4a.diff added


comment:1 Changed 9 years ago by khorn

Author: lorphlorph, khorn
Keywords: reveiw added

comment:2 Changed 9 years ago by khorn

Author: lorph, khornlorph
Cc: khorn added

comment:3 Changed 9 years ago by Thijs Triemstra

Branch: socksv4a-3886
Cc: Thijs Triemstra added
Keywords: review added; reveiw removed

Put ticket correctly in review queue.

comment:4 Changed 9 years ago by Jean-Paul Calderone

Keywords: review removed
Resolution: duplicate
Status: newclosed

This functionality really just belongs in #3886.

comment:5 Changed 8 years ago by <automation>

Owner: Glyph deleted
Note: See TracTickets for help on using tickets.