Documentation
¶
Overview ¶
Package socketio parses Socket.IO event-style packets from text frames.
The parser is intentionally lightweight so higher-level proxy packages can optionally decode Socket.IO traffic without taking a hard dependency on a specific capture or storage model.
Example ¶
namespace, event, argsJSON, ok := ParseEvent(`42/chat,17["message",{"body":"hello"}]`)
fmt.Println(namespace)
fmt.Println(event)
fmt.Println(argsJSON)
fmt.Println(ok)
Output: /chat message ["message",{"body":"hello"}] true
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseEvent ¶
ParseEvent tries to parse a Socket.IO v4/v3 event-like packet from a text frame. Supported types:
- "42" EVENT: 42[/nsp][,ack][args]
- "45" BINARY_EVENT: 45<attachments>-[/nsp][,ack][args]
- "43" ACK: 43[/nsp][,ack][args]
- "46" BINARY_ACK: 46<attachments>-[/nsp][,ack][args]
Returns (namespace, event, argsJSON, ok).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.