Skip to content

Instantly share code, notes, and snippets.

@marinho10
Last active March 9, 2018 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marinho10/2e9a7c8e40cfe34e782923472925b844 to your computer and use it in GitHub Desktop.
Save marinho10/2e9a7c8e40cfe34e782923472925b844 to your computer and use it in GitHub Desktop.
UserSocket
defmodule SuperSlimeGameWeb.UserSocket do
use Phoenix.Socket
## Channels
## Define game channel
channel("game:*", SuperSlimeGameWeb.GameChannel)
## Transports - long polling
transport(:websocket, Phoenix.Transports.WebSocket)
def connect(_params, socket) do
{:ok, socket}
end
def id(_socket), do: nil
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment