Class: RForce::Binding

Inherits:
Object
  • Object
show all
Defined in:
lib/databasedotcom_additions/rforce_proxy_patch.rb

Instance Method Summary collapse

Instance Method Details

#init_server(url) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/databasedotcom_additions/rforce_proxy_patch.rb', line 8

def init_server(url)
  @url = URI.parse(url)

  if proxy
    @server = Net::HTTP::Proxy(proxy.host, proxy.port).new(@url.host, 443)
  else
    @server = Net::HTTP.new(@url.host, 443)
  end

  #@server = Net::HTTP.new(@url.host, @url.port)
  @server.use_ssl = @url.scheme == 'https'
  @server.verify_mode = OpenSSL::SSL::VERIFY_NONE

  # run ruby with -d or env variable SHOWSOAP=true to see SOAP wiredumps.
  @server.set_debug_output $stderr if show_debug
end

#proxyObject



25
26
27
28
# File 'lib/databasedotcom_additions/rforce_proxy_patch.rb', line 25

def proxy
  http_proxy = ENV['http_proxy']
  URI.parse(http_proxy) rescue nil
end