Overview
Theeffect/unstable/socket module provides tools for working with socket connections:
- WebSocket client and server support
- Stream-based communication
- Automatic reconnection
- Error handling with typed errors
WebSocket client
Create a WebSocket connection:Sending messages
Send data through the socket:Receiving messages
Handle incoming messages:Socket as a Channel
Use sockets with Effect’s Channel API:String-based sockets
Work with string messages:Error handling
Handle socket errors:Socket options
Configure socket behavior:WebSocket server
Create a WebSocket server:Transform streams
Create sockets from transform streams:Complete example
Raw message handling
Handle both string and binary messages:See also
- HTTP Server - Build WebSocket servers
- Workers - Communicate with web workers