# File lib/em-http/client.rb, line 457
    def send_socks_connect_request
      # TO-DO: Implement address types for IPv6 and Domain
      begin
        ip_address = Socket.gethostbyname(@uri.host).last
        send_data [5, 1, 0, 1, ip_address, @uri.port].flatten.pack('CCCCA4n')

      rescue
        @state = :invalid
        on_error "could not resolve host", true
        return false
      end

      true
    end