What's new in Socket.IO for Go v3
mainSocket.IO for Go v3.0.0 is a major release that introduces several architectural and functional improvements:
- Monorepo Consolidation: Previously separate repositories (like
engine.io-go-parser,socket.io-client-go, etc.) are now merged into a single monorepo with 9 versioned submodules. - Protocol Alignment: The protocol is aligned with Socket.IO v4+, improving compatibility with the JavaScript ecosystem.
- Thread Safety: Includes concurrency fixes such as atomic socket flags, mutex-protected middleware, and goroutine leak prevention.
- Type Safety: Introduces
types.Atomic[T](replacingatomic.Value),types.Optional[T]for null safety, and strongly typedHandshakefields. - New Utility Packages: Includes
pkg/slices(safe slice operations),pkg/queue(ordered message delivery), andpkg/request(HTTP client). - Redis Cluster Support: Adds sharded broadcast operators and dynamic channel subscription management.
- DoS Prevention: Implements HTTP body size limits on polling transport and configurable attachment count limits.
- Minimum Go Version: Requires Go 1.26.0 or higher.