   end
 
   defp start_stream(%Conn{jid: jid} = conn) do
-    stanza = JID.parse(jid).server |> Stanza.start_stream()
+    stanza = jid |> host |> Romeo.Stanza.start_stream
+
     conn
     |> send(stanza)
     |> recv(fn conn, _packet ->

    end
  end

  defp default_host(jid) do
    JID.parse(jid).server
  end
end


  @spec connect(Keyword.t) :: {:ok, state} | {:error, any}
  def connect(%Conn{host: host, port: port, socket_opts: socket_opts} = conn) do
    host = (host || host(conn.jid)) |> to_char_list
    port = (port || @default_port)

    conn = %{conn | host: host, port: port, socket_opts: socket_opts}
