# websocket_client (Erlang)

> OTP-compliant WebSocket client for Erlang, over ws and wss

Source: https://talira.ai/catalog/websocket-client-erlang-r98fgre8
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / websockets / clients](https://talira.ai/categories/libraries/websockets/clients), [languages / erlang](https://talira.ai/categories/languages/erlang)
- Licence: MIT[^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Michael Coles](https://talira.ai/orgs/michael-coles.md)

websocket_client is a WebSocket client for Erlang. You write a callback module, much like a Cowboy WebSocket handler, and it connects over `ws` or `wss` (TCP or SSL), validates the handshake, masks frames, handles text, binary, ping, pong, close and continuation frames, and can send pings and keep the connection alive for you. It's OTP compliant and is now built on `gen_statem`. Michael Coles maintains it.

## Links

- GitHub: https://github.com/sanmiguel/websocket_client

## Problems it solves

- connect to a WebSocket server from my Erlang application
- an OTP websocket client with automatic reconnect and keepalive in Erlang
- talk to a wss endpoint from Elixir or Erlang without writing the protocol myself

## Features

- callback-driven behaviour, like a Cowboy websocket handler
- ws and wss (TCP and SSL) connections
- handshake validation and client-to-server masking
- text, binary, ping, pong, close and continuation frames
- automatic ping/pong and keepalive
- reconnect from the disconnect callback

## Limitations

- It uses verify_none for TLS by default (verifying the server's certificate is on its to-do list), and after its rework onto gen_statem its README says there may still be bugs.[^1]

## Trust

Overall: 0.19 out of 1.
Signals: maintenance 0.06, adoption 0.33, momentum 0.03, community 0.58, backing 0.30, extensibility 0.00.

- latest release 1.1.0 11.2 years ago
- 46 GitHub stars
- 27 contributors
- backed by Michael Coles

Warnings:

- last commit 12 months ago

## Alternatives

- [WebSockex](https://talira.ai/catalog/websockex-t3dvnw3d.md): An Elixir WebSocket client built on OTP processes

## Sources

[^1]: https://github.com/sanmiguel/websocket_client/blob/master/README.md (checked 28 Nov 2026)
[^2]: https://github.com/sanmiguel/websocket_client/blob/master/LICENSE.md (checked 28 Nov 2026)
