# Websocket server in Elixir or phoenix

**URL:** <https://forum.elixirforum.com/t/websocket-server-in-elixir-or-phoenix/51906>\
**Category:** Questions\
**Tags:** phoenix, websockets\
**Created:** [November 19, 2022, 8:42pm UTC](https://forum.elixirforum.com/t/websocket-server-in-elixir-or-phoenix/51906 "2022-11-19T20:42:01Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ruslandoga](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ruslandoga/32/22193_2.png) [@ruslandoga](https://forum.elixirforum.com/u/ruslandoga)\
**Post date:** [November 20, 2022, 1:44pm UTC](https://forum.elixirforum.com/t/websocket-server-in-elixir-or-phoenix/51906/2 "2022-11-20T13:44:32Z")

</div>

👋

Using `cowboy` might be easier than you think. [Here’s](https://github.com/ruslandoga/backend-for-ios-ws-experiments) a small example of how it could be done. The important bits are the [plug child spec](https://github.com/ruslandoga/backend-for-ios-ws-experiments/blob/e126a17f45b0382533a076b1375b83ec2f8907b7/lib/w/application.ex#L9-L10) and the [module implementing cowboy\_websocket behaviour.](https://github.com/ruslandoga/backend-for-ios-ws-experiments/blob/master/lib/web/socket.ex) You can ignore the `Web.UserSocket` and “pubsub” specifics.

[More info on `cowboy_websocket` behaviour.](https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_websocket/)

---

_[View the full topic](https://forum.elixirforum.com/t/websocket-server-in-elixir-or-phoenix/51906)._
