Class: RSocks::HttpProxyParser
- Inherits:
-
Object
- Object
- RSocks::HttpProxyParser
- Defined in:
- lib/r_socks/http_proxy_parser.rb
Instance Attribute Summary collapse
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #call(data) ⇒ Object
-
#initialize(state_machine, config) ⇒ HttpProxyParser
constructor
A new instance of HttpProxyParser.
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
#password ⇒ Object (readonly)
Returns the value of attribute password.
6 7 8 |
# File 'lib/r_socks/http_proxy_parser.rb', line 6 def password @password end |
#username ⇒ Object (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 |