What problem does it solve?
This Skill helps developers understand and implement WebSocket communication in Cangjie, covering server and client upgrades, frame handling, and connection management.
Core Features & Use Cases
- Server-side WebSocket: Implement WebSocket servers that handle client connections and upgrade requests.
- Client-side WebSocket: Develop WebSocket clients to connect to servers and exchange messages.
- Frame Handling: Understand and manage different WebSocket frame types (control, data, continuation) and their properties (
fin, payload).
- Message Fragmentation: Handle large messages that are split across multiple frames.
- Connection Lifecycle: Properly manage the WebSocket connection lifecycle, including sending close frames and responding to pings.
- Use Case: Build a real-time chat application or a live data feed service using Cangjie's WebSocket capabilities.
Quick Start
Use the cangjie-websocket skill to set up a basic WebSocket server that echoes messages back to the client.