Use Phoenix to parse content on external websocket

  • Phoenix uses web sockets to implement channels. The server side and client side code implements the necessary protocols that makes Phoenix channels work. Phoenix isn’t a framework to work with other protocols implemented over web sockets.

Strictly speaking the “Phoenix app” is entirely on the server side and in Elixir there are no objects. Phoenix does provide some JavaScript files to make it easier to work with the Phoenix channel protocol in the browser.

So if you are trying to consume a non-Phoenix web socket in the browser then you’ll have to use a separate JavaScript library or implement the necessary protocols yourself (e.g.
Writing WebSocket client applications.)

But there are also libraries that let you access web sockets from Elixir if that is what you need.