def initialize(uri, block)
unless (uri =~ /^https?:\/\//)
uri = "http://#{uri}"
end
@uri = uri
@block = block
@links = {}
@recurse = false
@verbose = false
@debug = false
@depth = nil
@sleep = 0
@done = false
@force = false
@brute = false
@peek = false
@types = Hash[ *%w(text/html text/xml application/xml).collect { |v| [v,1] }.flatten ]
@headers = {}
@proxy = nil
@proxyport = nil
Signal.trap("INT", lambda { @done = true and puts "Terminating -- ctrl-c" })
Signal.trap("USR1", lambda { @verbose = !@verbose and puts "Enabling verbose mode" })
Signal.trap("USR2", lambda { @debug = !@debug and puts "Enabling debug mode" })
end