Class: RProxy::HttpProxyParser

Inherits:
Object
  • Object
show all
Defined in:
lib/r_proxy/http_proxy_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(usage_manager) ⇒ HttpProxyParser

Returns a new instance of HttpProxyParser.



8
9
10
11
# File 'lib/r_proxy/http_proxy_parser.rb', line 8

def initialize(usage_manager)
  @usage_manager = usage_manager
  @max_connection_size = 4 * 1024
end

Instance Attribute Details

#passwordObject (readonly)

Returns the value of attribute password.



6
7
8
# File 'lib/r_proxy/http_proxy_parser.rb', line 6

def password
  @password
end

#usernameObject (readonly)

Returns the value of attribute username.



6
7
8
# File 'lib/r_proxy/http_proxy_parser.rb', line 6

def username
  @username
end

Instance Method Details

#parse(data, need_auth) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/r_proxy/http_proxy_parser.rb', line 13

def parse(data, need_auth)
  parse_connect_request(data)
  remain = 0
  remain = auth_user if need_auth

  [@schema.host, @schema.port, remain]
end