Class: SocksHandler::ProxyAccessRule

Inherits:
Rule
  • Object
show all
Defined in:
lib/socks_handler/proxy_access_rule.rb

Instance Attribute Summary

Attributes inherited from Rule

#host, #host_patterns, #password, #port, #username

Instance Method Summary collapse

Methods inherited from Rule

#match?, new

Constructor Details

#initialize(host_patterns:, socks_server:, username: nil, password: nil) ⇒ ProxyAccessRule

Returns a new instance of ProxyAccessRule.

Parameters:

  • host_patterns (Array<String, Regexp>)
  • socks_server (String)

    a string in the format “<host>:<port>”

  • username (String, nil) (defaults to: nil)
  • password (String, nil) (defaults to: nil)


10
11
12
13
# File 'lib/socks_handler/proxy_access_rule.rb', line 10

def initialize(host_patterns:, socks_server:, username: nil, password: nil)
  host, port = socks_server.split(":")
  super(host_patterns: host_patterns, host: host, port: port.to_i, username: username, password: password)
end

Instance Method Details

#directfalse

Returns:

  • (false)


16
17
18
# File 'lib/socks_handler/proxy_access_rule.rb', line 16

def direct
  false
end