Method: ManageEngine::APMConnector#connection

Defined in:
lib/agent/server/am_connector.rb

#connection(url) ⇒ Object



86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/agent/server/am_connector.rb', line 86

def connection(url)

  if (@obj.config.proxyneeded)
    @obj.log.debug "[connect] Through Proxy"
    con = Net::HTTP::Proxy(@obj.config.proxy_host, @obj.config.proxy_port,@obj.config.proxy_user,@obj.config.proxy_pass).new(url.host, url.port)    
  else
    #@obj.log.info "Proxy Not Needed"
    con = Net::HTTP.new(url.host, url.port)
  end
  con=getScheme(con)
  con.open_timeout = @obj.constants.connection_open_timeout
  con.read_timeout = @obj.constants.connection_read_timeout
  con
end