Module: Proxied::Shared::InstanceMethods

Defined in:
lib/proxied/shared.rb

Instance Method Summary collapse

Instance Method Details

#proxy_address(include_http: false) ⇒ Object



26
27
28
29
30
31
32
33
# File 'lib/proxied/shared.rb', line 26

def proxy_address(include_http: false)
  case self.auth_mode.to_sym
    when :credentials
      ::Proxied::Utilities.format_proxy_address(host: self.host, port: self.port, include_http: include_http)
    when :basic_auth
      ::Proxied::Utilities.format_proxy_address(host: self.host, port: self.port, username: self.username, password: self.password, include_http: include_http)
  end
end

#proxy_credentialsObject



35
36
37
# File 'lib/proxied/shared.rb', line 35

def proxy_credentials
  ::Proxied::Utilities.format_proxy_credentials(self.username, self.password)
end

#proxy_options_for_faradayObject



43
44
45
# File 'lib/proxied/shared.rb', line 43

def proxy_options_for_faraday
  ::Proxied::Utilities.proxy_options_for_faraday(host: self.host, port: self.port, username: self.username, password: self.password, auth_mode: self.auth_mode)
end

#socks_proxy_credentialsObject



39
40
41
# File 'lib/proxied/shared.rb', line 39

def socks_proxy_credentials
  ::Proxied::Utilities.socks_proxy_credentials(username: self.username, password: self.password)
end