8.5 KiB
8.5 KiB
Overview of Examples
The examples give an overview of the features of by providing working code.
Read, run, and modify as you like!
Note
Most examples provide HTML clients and/or JavaScript versions of the Python code. JavaScript code for WAMP v2 runs both in the browser and in Node.js.
WebSocket
provides WebSocket both under Twisted and asyncio.
Basic Examples
Additional Examples (Twisted only)
- Broadcasting over WebSocket
- WebSocket Compression
- WebSocket over Twisted Endpoints
- Using HTTP Headers with WebSocket
- WebSocket on Multicore
- WebSocket as a Twisted Service
- Running WebSocket under Twisted Web
- Running secure WebSocket under Twisted Web
- WebSocket Echo over secure WebSocket
- WebSocket Echo Variants
- WebSocket Fallbacks
- WebSocket and WSGI/Flask
- Using multiple WebSocket Protocols
- WebSocket Pings/Pongs
- Streaming WebSocket
- Wrapping Twisted Protocol/Factories over WebSocket
WAMP v2
Publish & Subscribe (PubSub)
Remote Procedure Calls (RPC)
- Time Service Twisted - asyncio - A trivial time service - demonstrates basic remote procedure feature.
- Slow Square Twisted - asyncio - Demonstrates procedures which return promises and return asynchronously.
- Arguments Twisted - asyncio - Demonstrates all variants of call arguments.
- Complex Result Twisted - asyncio - Demonstrates complex call results (call results with more than one positional or keyword results).
- Errors Twisted - asyncio - Demonstrates error raising and catching over remote procedures.
- Progressive Results Twisted - asyncio - Demonstrates calling remote procedures that produce progressive results.
- Options Twisted - asyncio - Using options with RPC.
WAMP v1
Examples demonstrating specific features:
Publish & Subscribe
Remote Procedure Calls
Authentication
and small example apps