Categorygithub.com/ashpect/websocket-go
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

  1. Connection Management:
  • The server should allow users to connect and disconnect.
  • Upon connection, the server should issue a unique session ID to the user.
  1. 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.
  1. Server-Side Events:
  • The server should be capable of sending messages to clients without receiving a client message (server-side push).
  1. 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

  1. Scalability:
  • The server should handle at least 50,000 concurrent connections.
  1. Deployment:
  • Depoyment scripts in bash
  • Contanerize in docker/k8s

Good-to-Have Features

  1. Session Reconnection:
  • After disconnection, clients can reconnect to their session using the same session ID.
  • Authtoken based reconnection and not simply session based.
  1. Session Inactivity Management:
  • If a session is inactive for more than 5 minutes, the server should automatically disconnect the user.
  1. 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).