         """
       end
 
-      @socket_mount mount
+      @phoenix_socket_mount mount
       @transports opts[:via]
       @channel_alias opts[:alias]
-      get  @socket_mount, Phoenix.Transports.WebSocket, :upgrade, Dict.take(opts, [:as])
-      get  @socket_mount <> "/poll", Phoenix.Transports.LongPoller, :poll
-      post @socket_mount <> "/poll", Phoenix.Transports.LongPoller, :open
-      put  @socket_mount <> "/poll", Phoenix.Transports.LongPoller, :publish
+      get  @phoenix_socket_mount, Phoenix.Transports.WebSocket, :upgrade, Dict.take(opts, [:as])
+      get  @phoenix_socket_mount <> "/poll", Phoenix.Transports.LongPoller, :poll
+      post @phoenix_socket_mount <> "/poll", Phoenix.Transports.LongPoller, :open
+      put  @phoenix_socket_mount <> "/poll", Phoenix.Transports.LongPoller, :publish
       unquote(chan_block)
-      @socket_mount nil
+      @phoenix_socket_mount nil
       @transports nil
       @channel_alias nil
     end

  """
  defmacro channel(topic_pattern, module, opts \\ []) do
    quote bind_quoted: binding do
      unless @socket_mount do
        raise """
        You are trying to call `channel` outside of a `socket` block.
        Please move your channel definitions inside a `socket` block.
        """
      end

      @channels {topic_pattern,
                 Module.concat(@channel_alias, module),
                 Dict.merge([via: @transports], opts)}
    end
  end
end

  defp prelude() do
    quote do
      Module.register_attribute __MODULE__, :phoenix_routes, accumulate: true
      Module.register_attribute __MODULE__, :phoenix_channels, accumulate: true

      import Phoenix.Router
      import Plug.Conn
