https://github.com/n9te9/aria
aria is WebSocket Framework Inspired by olahol/melody, based on coder/websocket.
https://github.com/n9te9/aria
chat framework go golang real-time realtime-messaging websocket
Last synced: 5 months ago
JSON representation
aria is WebSocket Framework Inspired by olahol/melody, based on coder/websocket.
- Host: GitHub
- URL: https://github.com/n9te9/aria
- Owner: n9te9
- License: mit
- Created: 2025-08-24T05:59:54.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-08-26T10:26:33.000Z (10 months ago)
- Last Synced: 2025-10-20T14:58:19.341Z (8 months ago)
- Topics: chat, framework, go, golang, real-time, realtime-messaging, websocket
- Language: Go
- Homepage:
- Size: 18.6 KB
- Stars: 5
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Aria
**Aria** is a lightweight, event-driven WebSocket framework for Go.
Aria is inspired by [olahol/melody](https://github.com/olahol/melody), and based on [coder/websocket](https://github.com/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.
---
## Features
- ✅ Simple API inspired by event-driven frameworks
- ✅ Hook functions: `OnConnect`, `OnMessage`, `OnClose`, `OnDisconnect`, `OnMessageBinary`, `OnError`
- ✅ Broadcast support (`BroadCast` and `BroadCastFilter`)
- ✅ Connection lifecycle management with graceful cleanup
- ✅ Context-aware connection handling (`Handle` and `HandleWithContext`)
- ✅ Support for WebSocket compression and subprotocols via options
---
## Installation
```bash
go get github.com/n9te9/aria
```
## Quick Start
See the [_example/chat](https://github.com/n9te9/aria/tree/main/_example/chat) directory for a complete chat application using Aria.
This includes both a Go WebSocket server and a simple HTML/JavaScript client.
## Contribution
Contributions are welcome! 🎉
If you’d like to improve Aria, please follow these steps:
1. Fork the repository
2. Create a feature branch (git checkout -b feature/my-feature)
3. Write your code and add/update tests
4. Run go test ./... to ensure all tests pass
5. 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.