Connecting from phoenix to a 3rd party WebSockets API


Kinda new to phoenix so please forgive my ignorance. I am trying to use a 3rd party WebSockets API by connecting to it from my phoenix app.

As of 2024, what is the recommended way to connect to a websockets endpoint? Is there some library I could use? I didn’t feel very sure with the ones I found so I thought asking here.

One of the libraries I found was this one: GitHub - Azolo/websockex: An Elixir Websocket Client

Thank you for your time.

I am trying to find an answer as well. websockex seems not to be maintained anymore.

I have been using websockex all this time and it seems to be working fine so far so I recommended giving it a try until someone says otherwise :slight_smile:


There’s also @bunopnu’s Fresh - WebSocket client built atop the Mint | Elixir Forum.

1 Like

I’m still preparing for university entrance exam, so adding new features isn’t possible right now. However, Fresh should just work well.

If you run into any bugs, please don’t hesitate to open a new issue on GitHub.

1 Like

I have also found that :gun has a low-level websocket support, but that might be too verbose protocol handling for application level logic