Class: Strawman::HttpRequest
- Inherits:
-
Object
- Object
- Strawman::HttpRequest
- Defined in:
- lib/strawman/http_request.rb
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(proxy_list, url) ⇒ HttpRequest
constructor
A new instance of HttpRequest.
Constructor Details
#initialize(proxy_list, url) ⇒ HttpRequest
Returns a new instance of HttpRequest.
3 4 5 6 7 |
# File 'lib/strawman/http_request.rb', line 3 def initialize(proxy_list, url) @proxy = proxy_list.proxy proxied_url = @proxy.proxy_url(url) @request = EventMachine::HttpRequest.new(proxied_url) end |
Instance Method Details
#get ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/strawman/http_request.rb', line 9 def get http = @request.get :head => {"referer" => @proxy.referer} http.callback { # TODO: Munge the return output so that the stuff added by Glype is # removed } http end |