Class: Strawman::GlypeProxy
Overview
An implementation of the Proxy class which is specific to Glype proxies. See: www.glype.com/ for more details.
Instance Attribute Summary
Attributes inherited from Proxy
Instance Method Summary collapse
- #to_s ⇒ Object
-
#validate(verification_url) ⇒ Object
Verifies whether this proxy is currently functional.
Methods inherited from Proxy
#==, #initialize, #proxy_url, #referer, #valid?, #validate_response
Constructor Details
This class inherits a constructor from Strawman::Proxy
Instance Method Details
#to_s ⇒ Object
80 81 82 |
# File 'lib/strawman/proxy.rb', line 80 def to_s "<GlypeProxy #{@root_url}>" end |
#validate(verification_url) ⇒ Object
Verifies whether this proxy is currently functional. Returns a deferable.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/strawman/proxy.rb', line 64 def validate(verification_url) @valid = false # FIXME: This only validate proxies that don't require a unique session # cookie which is retrieved by going to the root page and looking for the # s cookie. url = proxy_url(verification_url) http = Transport.new(url).get :head => {'referer' => @root_url} http.callback { @validate_response = http.response @valid = true if http.response_header.status == 200 } http end |