   end
 
   def websocket_init(_TransportName, req, _opts) do
+    IO.puts("websocket_init: #{inspect(req.port)}")
     ws_broadcast(:nodes, {:new, :erlang.pid_to_list(self())})
     {:ok, req, :undefined_state }
   end

  end

  def websocket_info({:nodes, ref, _foo}, req, state) do
    ret = case ref do
      { :new, pid } -> "new node "<>:erlang.list_to_binary(pid)
      { :bye, pid } -> "bye node "<>:erlang.list_to_binary(pid)
      other -> syntax_error(other)
    end
    nodes = ws_list
      |>Enum.map(fn(pid)->:erlang.pid_to_list(pid) end)
      |>:erlang.list_to_binary
    this_node = self()

  @doc """
  Gets the list of all active websocket PIDs from the ranch supervisor.
  """
  def ws_list(port) do
    IO.puts("porty: #{inspect(port)}")
    {_site, info} = get_info(port)
    IO.puts("infoy: #{inspect(info)}")
    Process.whereis(:ranch_sup) 
      |> Supervisor.which_children
      |> Enum.find(fn(x) -> elem(x,0) == {:ranch_listener_sup, :http} end)
