Class: Strawman::HttpRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/strawman/http_request.rb

Instance Method Summary collapse

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

#getObject



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