Example repository demonstrating usage and conformance tests for the Go Socket.IO implementation by zishang520. This repo contains multiple example applications and an automated test-suite that exercises Engine.IO and Socket.IO behaviors.
| Example | Description |
|---|---|
| benchmark | Memory/goroutine leak benchmark with high-frequency connect/disconnect |
| chat | Classic chat room with usernames, typing indicators, and join/leave notifications |
| basic-crud-application | Real-time CRUD operations on a shared TODO list with broadcast updates |
| middleware-auth | Token-based authentication middleware with admin namespace authorization |
| test-suite | Protocol conformance tests for Engine.IO and Socket.IO |
Each example is a standalone Go module. To run any example:
cd examples/<example-name>
go run main.goTo run tests:
cd examples/<example-name>
go test -v -race ./...- Multiple users join with unique usernames
- Real-time message broadcasting
- Typing indicator notifications
- User join/leave events with active user count
- Create, read, update, delete TODO items
- All changes broadcast to connected clients in real-time
- Acknowledgement (ack) support for operation confirmation
- Thread-safe in-memory storage
- Namespace-level middleware for connection authentication
- Token validation before connection is established
- Admin-only namespace with additional authorization
- Profile retrieval via acknowledgements
- Engine.IO handshake (HTTP long-polling + WebSocket)
- Engine.IO heartbeat (ping/pong + timeout)
- Engine.IO session close and upgrade
- Socket.IO connect/disconnect with namespaces
- Socket.IO message passing (plain-text, binary, ack)
- Payload limits, edge cases, and session management