Tor not generating ADDRMAP Events for Externally Resolved HTTP(S) Requests
Tor Version 0.3.2.10 Stem Version 1.6.0
Previous use of Stem with Tor used to to generate ADDRMAP events that would provide which hostnames were resolved to which IP addresses. Not sure what component changed along the way, but it does not appear to generate ADDRMAP events anymore. The change was noticed a month or two ago, but I didn't run this check at every upgrade, so I don't know exactly what changed/when.
I use the following to create a Tor process and to add event listeners for ADDRMAP and STREAM events with Stem. Relevant Code:
config = {"ControlPort": "9050",
"DataDirectory": "/some_directory",
"MaxCircuitDirtiness": "3600",
"SocksPort": "7000",
"StrictNodes": "1"}
def start(self):
self.process = stem.process.launch_tor_with_config(self.config, timeout=180, take_ownership=True)
self.controller = stem.control.Controller.from_port(port=int(self.config['ControlPort']))
self.controller.authenticate()
self.controller.set_caching(False)
#self.controller.add_event_listener(self.exitCheck, stem.control.EventType.STREAM)
self.controller.add_event_listener(self.addrMap, stem.control.EventType.ADDRMAP)
return (self.process, self.controller)
def addrMap(self,resolution):
print("Added resolution of {0} to {1}".format(resolution.hostname,resolution.destination))
self.resources.add(resolution.hostname+','+resolution.destination)
The commented line registers another listener that listens for STREAM events -- those work and are printed out. cURL and a Selenium driven browser are successfully passed through Tor (ipecho shows the expected exit IP address), but they do not generate a ADDRMAP event. Additionally, subsequent requests (via HTML events or JS, etc) from a page make it through Tor, but they receive a general server failure, which might be a separate issue.
Trac:
Username: jparkerdiamond