A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://autobahn.readthedocs.io/en/latest/websocket/examples.html below:

Website Navigation


WebSocket Examples — autobahn 22.8.1.dev1 documentation

WebSocket Examples¶ Basic Examples¶

Note

The examples here demonstrate WebSocket programming with Autobahn and are available in Twisted and asyncio-based variants respectively.

Slow Square¶

Twisted / asyncio

This example shows a WebSocket server that will receive a JSON encode float over WebSocket, slowly compute the square, and send back the result. The example is intended to demonstrate how to use co-routines inside WebSocket handlers.

Additional Examples¶

Note

The examples here demonstrate various further features and aspects of WebSocket programming with Autobahn. However, these examples are currently only available for Twisted.

Secure WebSocket¶

Twisted

How to run WebSocket over TLS (“wss”).

WebSocket and Twisted Web¶

Twisted

How to run WebSocket under Twisted Web. This is a very powerful feature, as it allows you to create a complete HTTP(S) resource hierarchy with different services like static file serving, REST and WebSocket combined under one server.

Twisted Web, WebSocket and WSGI¶

Twisted

This example shows how to run Flask (or any other WSGI compliant Web thing) under Twisted Web and combine that with WebSocket.

Secure WebSocket and Twisted Web¶

Twisted

A variant of the previous example that runs a HTTPS server with secure WebSocket on a subpath.

WebSocket Ping-Pong¶

Twisted

The example demonstrates how to trigger and process WebSocket pings and pongs.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4