A WebSocket client written in Erlang
This project was born as a side project while I'm doing my end of dregree project. What this means is:
- I don't have too much time to include new features.
- I'll try to fix any bugs.
- I'll try to finish anything on the TODO.
- If anyone suggests something interesting/cool, I'll try to include it : )
Please notice that currently, neither subprotocols nor extensions are currently available.
Add this repo as a dependency to your rebar.config file and then
1>wsecli:start("echo.websocket.org", 80, "/").
Add a callback for received messages,
2>wsecli:on_message(fun(text, Message)-> io:format("Echoed message: ~s ~n", [Message]) end).
Send a message that will be echoed,
3> wsecli:send("Hello"). ok Echoed message: Hello
And finally to stop it
Callbacks for the events: on_open, on_error, on_message and on_close can be added. Check the code or the documentation for details.
To run them
or, in case you don't have rake installed,
rebar compile && ERL_LIBS='deps/' ./espec test/spec/
- Accept WebSocket uris (those with ws:// format).
- Support streaming (not sure how to do this).
- Support ssl.
- Creation on multiple clients (too lazy, that's why I haven't done it already)
Licensed under Apache 2.0. Check LICENSE for details
If you find or think that something isn't working properly, just open an issue.
Pull requests and patches (with tests) are welcome.