socketio
socketio parses event-style Socket.IO text packets without forcing Socket.IO into the WebSocket transport itself.
That design is intentional:
wsproxystays reusable for all WebSocket traffic- Socket.IO decoding remains optional
- higher-level protocol interpretation happens in your adapter layer
Main entry point
go
namespace, event, argsJSON, ok := socketio.ParseEvent(packet)What it supports
ParseEvent understands common Socket.IO v3 and v4 event-like text packet forms:
42event packets45binary event packets43ack packets46binary ack packets
Example
go
namespace, event, argsJSON, ok := socketio.ParseEvent(`42/chat,17["message",{"body":"hello"}]`)Typical result:
namespace:/chatevent:messageargsJSON: raw JSON array payload
Why raw JSON output is useful
The package returns the event payload as JSON text instead of binding it to a fixed struct.
That keeps the package:
- lightweight
- schema-agnostic
- useful for debuggers, inspectors, and custom adapters