Skip to main content

Asynchronous WSGI and WebSocket server based on asyncore module

Project description

This is a single-threaded asynchronous WSGI server with WebSockets support based on asyncore module. It should be compatible with Python 2.7 and 3.

Example:

from from wsgiref.simple_server import demo_app
from asyncore_wsgi import AsyncWebSocketHandler, make_server


class SimpleEchoHandler(AsyncWebSocketHandler):

    def handleMessage(self):
        print('Received WebSocket message: {}'.format(self.data))
        self.sendMessage(self.data)

    def handleConnected(self):
        print('WebSocket connected')

    def handleClose(self):
        print('WebSocket closed')


httpd = make_server('', 8000, demo_app, ws_handler_class=SimpleEchoHandler)
httpd.serve_forever()

The server in the preceding example serves a demo WSGI app from the Standard Library and the echo WebSocket handler on '/ws' path.

WebSocket part was borrowed from this project.

License

MIT, see LICENSE.txt

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

asyncore-wsgi-0.0.10.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asyncore_wsgi-0.0.10-py2.py3-none-any.whl (10.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file asyncore-wsgi-0.0.10.tar.gz.

File metadata

  • Download URL: asyncore-wsgi-0.0.10.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for asyncore-wsgi-0.0.10.tar.gz
Algorithm Hash digest
SHA256 22fa129dc78ee7b9d31c684bd5c049bdb67f539207eba3559b8b16cf4a33b452
MD5 bdda0843595c13901be68203b7a9c8fa
BLAKE2b-256 db68df25acef174337b196fea9d2e12a4fd5b20849ee9034d874d72ed1596513

See more details on using hashes here.

File details

Details for the file asyncore_wsgi-0.0.10-py2.py3-none-any.whl.

File metadata

  • Download URL: asyncore_wsgi-0.0.10-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for asyncore_wsgi-0.0.10-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 66c7cfcb209c5b0aa8bdfb48d7ebe3ef2dcd2b085c29fde2930073db2220157c
MD5 7b7cd5f5528591c90c36c31b41df70a7
BLAKE2b-256 1bfeddad4c4da0dcb34579940e55c96b677d7d6ba984ad44682ed78d1c57ef00

See more details on using hashes here.

Supported by

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