Use Phoenix to parse content on external websocket

Hi People,

Does anybody has an idea how to use the phoenixframework to consume content(events) from a websocket.

I have a websocket I can connect to with for example wscat. The content is Json and should be parsed and logged in a DB.
The Phoenix app should use this content to update state’s of object.

I also need a way to initialise and make sure websocket is connected to not mis out on important information about state changes of objects etc.

Thanks for any directions