# Websockets Network

> Asynchronous bi-directional WebSocket client and server configuration in Python.

- Skill: `lord1egypt/websockets-network-2` (Agent Skill)
- Install (CLI): `npx skillmds@latest add lord1egypt/websockets-network-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/lord1egypt/websockets-network-2/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT license
- Author: Lord1Egypt (https://skillmd.com/u/lord1egypt)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/lord1egypt/websockets-network-2

---


# Websockets Network

## Overview
WebSockets enable two-way interactive communication sessions between the user's browser and a server.

## When to Use This Skill
Use for live chats, real-time tickers, dashboard streaming, or prompt monitoring terminals.

## Quick Start (with runnable code examples)

```python
import asyncio
import websockets

async def echo(websocket):
    async for message in websocket:
        await websocket.send(f"Echo: {message}")

async def main():
    async with websockets.serve(echo, "localhost", 8765):
        await asyncio.Future()  # run forever

# To execute: asyncio.run(main())
```

## Advanced Usage
Handle WebSocket ping-pong keepalives, custom header handshakes, and event connection retries.

## Key References
- [WebSockets documentation](https://websockets.readthedocs.io/)

## Dependencies
- websockets>=12.0.0

