Class: RSocks::HttpProxyParser

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(state_machine, config) ⇒ HttpProxyParser

Returns a new instance of HttpProxyParser.



8
9
10
11
12
13
14
15
16
# File 'lib/r_socks/http_proxy_parser.rb', line 8

def initialize(state_machine, config)
  @state_machine = state_machine
  @auth_method = config.auth_method
  @default_user = ENV['RSOCKS_USER'] || 'default'
  @default_password = ENV['RSOCKS_PASSWORD'] || 'default'
  @adaptor = config.auth_adaptor
  @health_check_route = config.health_check_route
  @need_auth = config.auth_method != :no_auth
end

Instance Attribute Details

#passwordObject (readonly)

Returns the value of attribute password.



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

def password
  @password
end

#usernameObject (readonly)

Returns the value of attribute username.



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

def username
  @username
end

Instance Method Details

#call(data) ⇒ Object



18
19
20
21
22
# File 'lib/r_socks/http_proxy_parser.rb', line 18

def call(data)
  parser_connect_http(data)
  @state_machine.start!
  [@schema_parse.host, @schema_parse.port]
end