require File.dirname(__FILE__) + '/../lib/typhoeus.rb'hydra = Typhoeus::Hydra.newhydra.disable_memoizationurls = ['http://google.com','http://testphp.vulnweb.com','http://demo.testfire.net','http://example.net',]10.times {|i|req = Typhoeus::Request.new( urls[ i % urls.size] )req.on_complete {|res|puts 'URL: ' + res.effective_urlputs 'Time: ' + res.time.to_sputs 'Connect time: ' + res.connect_time.to_sputs 'App connect time: ' + res.app_connect_time.to_sputs 'Start transfer time: ' + res.start_transfer_time.to_sputs 'Pre transfer time: ' + res.pretransfer_time.to_sputs '-------------'}hydra.queue( req )puts 'Queued: ' + req.url}putsputs 'Harvesting responses...'putshydra.runputsputs 'Done.'puts
Tuesday, April 12, 2011
Typhoeus Examples
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment