Skip to content

Releases: coregx/stream

v0.1.0 - Initial release

19 Nov 14:12

Choose a tag to compare

🌊 stream v0.1.0 - Production-Ready SSE and WebSocket for Go 1.25+

✨ Highlights

  • RFC 6455 compliant WebSocket - Full protocol implementation with 99 tests (84.3% coverage)
  • RFC text/event-stream compliant SSE - Complete implementation with 215 tests (92.3% coverage)
  • Zero external dependencies - Pure stdlib implementation
  • Production-ready - 314 tests, load tested, stress tested
  • High performance - 13K WebSocket broadcasts/s, near-zero allocation
  • Type-safe - Generic Hub[T] for broadcasting

📦 Installation

go get github.com/coregx/stream@v0.1.0

🚀 WebSocket Features

Core Implementation:

  • RFC 6455 compliant WebSocket protocol
  • websocket.Conn - Connection with Read/Write API
  • websocket.Upgrade() - HTTP to WebSocket handshake
  • Frame parsing, fragment reassembly, UTF-8 validation
  • Automatic Ping/Pong handling
  • Close handshake with 15 standard codes

Broadcasting:

  • websocket.Hub - Multi-client broadcast manager
  • Thread-safe concurrent operations
  • Broadcast(), BroadcastText(), BroadcastJSON()
  • Automatic cleanup on failures

Performance:

  • 11 μs/op for 10 clients
  • 75 μs/op for 100 clients (~13K broadcasts/s)
  • 223 MB/s throughput for large messages

🌊 SSE Features

Core Implementation:

  • sse.Event - Event builder with fluent API
  • sse.Conn - Connection management
  • sse.Hub[T] - Generic type-safe broadcasting
  • Automatic heartbeat support

Performance:

  • 8 μs/op for 10 clients
  • 52 μs/op for 100 clients

📊 Testing & Quality

  • 314 total tests (215 SSE + 99 WebSocket)
  • 84.3% coverage (SSE: 92.3%, WebSocket: 84.3%)
  • 23 benchmarks with comprehensive metrics
  • Load tested: 100 concurrent connections, 1,000 broadcasts
  • Stress tested: 10MB messages, rapid connect/disconnect

📚 Documentation

🎯 Examples

  • WebSocket: Echo server, Chat server with Hub, Ping/Pong keep-alive
  • SSE: Basic time stream, Multi-client chat

🙏 Special Thanks

Professor Ancha Baranova - This project would not have been possible without her invaluable help and support. Her assistance was crucial in making all coregx projects a reality.


Full changelog: https://github.com/coregx/stream/blob/main/CHANGELOG.md