Skip to main content

WebSocket support for Flask

Project description

flask-sock

WebSocket support for Flask

Installation

pip install flask-sock

Example

from flask import Flask, render_template
from flask_sock import Sock

app = Flask(__name__)
sock = Sock(app)


@sock.route('/echo')
def echo(sock):
    while True:
        data = sock.receive()
        sock.send(data)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask-sock-0.0.4.tar.gz (1.7 kB view details)

Uploaded Source

Built Distribution

flask_sock-0.0.4-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file flask-sock-0.0.4.tar.gz.

File metadata

  • Download URL: flask-sock-0.0.4.tar.gz
  • Upload date:
  • Size: 1.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.8.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.6

File hashes

Hashes for flask-sock-0.0.4.tar.gz
Algorithm Hash digest
SHA256 1f7a240cf90894af3e9d5645b70101ea617acbeb1abea0e4f32663b410cc377a
MD5 d958dc0a00d45a25516303a2afe47dd0
BLAKE2b-256 6e617118dc69ea81ddb83aa838ea18d9c0cf920d310bacfaa7a3941d44f48f5f

See more details on using hashes here.

Provenance

File details

Details for the file flask_sock-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: flask_sock-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.8.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.6

File hashes

Hashes for flask_sock-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0c73e2c14ca3b6bb5856f6bdb78549bb1506d1ec253d6bd266924e729b473a94
MD5 d21282ffec52a8f4a9af8b39d284af87
BLAKE2b-256 86a3f04d04b1b97bcf4e9dd31a6430ec7c8d1ff9ab3f114122627081b6718043

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page