class Faraday::Connection

def proxy_from_env(url)

def proxy_from_env(url)
  return if Faraday.ignore_env_proxy
  uri = nil
  case url
  when String
    uri = Utils.URI(url)
    uri = if uri.host.nil?
            find_default_proxy
          else
            URI.parse("#{uri.scheme}://#{uri.host}").find_proxy
          end
  when URI
    uri = url.find_proxy
  when nil
    uri = find_default_proxy
  end
  ProxyOptions.from(uri) if uri
end