Aria is a lightweight, event-driven WebSocket framework for Go.
Aria is inspired by olahol/melody, and based on coder/websocket.
It provides a simple API for managing WebSocket connections, broadcasting messages, and handling events like OnConnect, OnMessage, OnClose, and OnDisconnect.
The goal of Aria is to make building real-time applications (chat servers, dashboards, games, etc.) as straightforward as possible while keeping performance and code clarity.
- ✅ Simple API inspired by event-driven frameworks
- ✅ Hook functions:
OnConnect,OnMessage,OnClose,OnDisconnect,OnMessageBinary,OnError - ✅ Broadcast support (
BroadCastandBroadCastFilter) - ✅ Connection lifecycle management with graceful cleanup
- ✅ Context-aware connection handling (
HandleandHandleWithContext) - ✅ Support for WebSocket compression and subprotocols via options
go get github.com/n9te9/ariaSee the _example/chat directory for a complete chat application using Aria. This includes both a Go WebSocket server and a simple HTML/JavaScript client.
Contributions are welcome! 🎉 If you’d like to improve Aria, please follow these steps:
- Fork the repository
- Create a feature branch (git checkout -b feature/my-feature)
- Write your code and add/update tests
- Run go test ./... to ensure all tests pass
- Open a Pull Request with a clear description of your changes
Please also check for consistency in naming conventions, comments, and code style before submitting.