I'd like to try to start using Erlang, and there's a data feed i'd like to read that's distributed via Websockets. Right now i'm doing the same in node.js using the 'websocket-client
' module, but could someone suggest a websocket client library for Erlang that I could look at? (Or an alternative solution if I'm off the mark)
Websocket client in Erlang
here you are: https://github.com/MiCHiLU/erlang_websocket
you may consider also gun: https://github.com/extend/gun
Here is a promising one: https://github.com/jeremyong/websocket_client
This one didn't exist at the time the question was asked, but it's a good question that deserves to be updated.
Thanks for the plug. I wrote this one so I could test my server websocket code in Erlang. The biggest things other clients were missing was wss support (https protocol), and continuation frames. –
Katzir
@Katzir I was trying to use your websocket client against a cowboy websocket server but with no success. So the ws_ping_example.erl that you gave uses a
websocket_client:cast(self(), Msg)
to send a message to remote server but I cant use the same function anywhere else in the ping example code. also, is the handler only to receive messages from the remote server or can that handler also send data over websocket? Can you please throw some light ? thanks a lot. –
Inequality @Katzir Can you post a very simple example as to how we can send data to remote server. I see that you use
websocket_client:cast/2
but cant seem to use that else except the init/2 callback of the websocket_client_handler
behavior. Thanks! –
Inequality ninenines/gun seems to be the most up-to-date according to the GitHub repository page.
Here is the documentation guide on how to use it with WebSockets: https://ninenines.eu/docs/en/gun/2.0/guide/websocket/
© 2022 - 2025 — McMap. All rights reserved.
misultin
is an erlang web server and seems to have websocket support. – CryptoclasticHere's one
– Cryptoclastic