Module: HttpUtilities::Proxies::Mysql::ProxyModule::InstanceMethods

Defined in:
lib/http_utilities/proxies/mysql/proxy_module.rb

Instance Method Summary collapse

Instance Method Details

#proxy_address(include_http = false) ⇒ Object



68
69
70
# File 'lib/http_utilities/proxies/mysql/proxy_module.rb', line 68

def proxy_address(include_http = false)
  return ::Proxy.format_proxy_address(self.host, self.port, include_http)
end

#proxy_credentialsObject



72
73
74
# File 'lib/http_utilities/proxies/mysql/proxy_module.rb', line 72

def proxy_credentials
  return ::Proxy.format_proxy_credentials(self.username, self.password)
end

#socks_proxy_credentialsObject



76
77
78
79
80
81
82
83
84
85
86
# File 'lib/http_utilities/proxies/mysql/proxy_module.rb', line 76

def socks_proxy_credentials
  credentials     =   {}

  if (!self.username.empty? && !self.password.empty?)
    credentials   =   {user: self.username, password: self.password}
  elsif (!self.username.empty? && self.password.empty?)
    credentials   =   {user: self.username}
  end

  return credentials
end