# File lib/em-http/http_client_options.rb, line 30
  def set_uri(uri, path = nil, query = nil)
    uri = uri.kind_of?(Addressable::URI) ? uri : Addressable::URI::parse(uri.to_s)
    uri.path = path if path
    uri.path = '/' if uri.path.empty?

    @uri = uri
    @path = uri.path
    @host = uri.host
    @port = uri.port
    @query = query

    # Make sure the ports are set as Addressable::URI doesn't
    # set the port if it isn't there
    if @port.nil?
      @port = @uri.scheme == "https" ? 443 : 80
    end

    uri
  end