modulepackage
0.0.0-20241118195252-ab9ecb8fb9ea
Repository: https://github.com/ashpect/websocket-go.git
Documentation: pkg.go.dev
# README
Websocket-Go
A minimal websocket server in Go which concurrently manages user sessions, respond to client messages, and support server-side events.
Functional Features
- Connection Management:
- The server should allow users to connect and disconnect.
- Upon connection, the server should issue a unique session ID to the user.
- Message Handling:
- While connected, users can send messages to the server.
- For each message received, the server should return a hardcoded response along with the current message count for that session.
- Server-Side Events:
- The server should be capable of sending messages to clients without receiving a client message (server-side push).
- Benchmarking:
- Provide a basic benchmarking script that simulates clients. Each simulated client should send the same dummy message and receive a response.
- The benchmarking script must measure:
- [x]Total failures (e.g., no response received or connection dropped).
- [x]Total throughput of the WebSocket server.
Non-Functional Features
- Scalability:
- The server should handle at least 50,000 concurrent connections.
- Deployment:
- Depoyment scripts in bash
- Contanerize in docker/k8s
Good-to-Have Features
- Session Reconnection:
- After disconnection, clients can reconnect to their session using the same session ID.
- Authtoken based reconnection and not simply session based.
- Session Inactivity Management:
- If a session is inactive for more than 5 minutes, the server should automatically disconnect the user.
- Advanced Benchmarking:
In addition to the basic benchmarking:
- Track and measure total memory usage.
- Record the avg/median/low/high latency per session once a client disconnects [] Provide plots or visualizations of these metrics.
# Packages
No description provided by the author
# Structs
TokenClaims represents the structure of your custom claims (without role).