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.9.tar.gz (10.1 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.9-py2.py3-none-any.whl (10.0 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: asyncore-wsgi-0.0.9.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for asyncore-wsgi-0.0.9.tar.gz
Algorithm Hash digest
SHA256 27ddeecdc4d79c98a687e899c5b7d2df38bb9538b65c92abddd2009f961835a8
MD5 b0d5438c4768fad8de444424a23c3112
BLAKE2b-256 b69e800239e0ba9d5b3b07ddc5c11711da9f0da2347e01c56f84d8cb53efac0a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: asyncore_wsgi-0.0.9-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for asyncore_wsgi-0.0.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 de043ee1544ae1a2602ef6f8cde41b7bd9f9b29d459e1c1514fa1c655aa7c841
MD5 f947ae74dd09c5dfc1fd79f4b7cb9371
BLAKE2b-256 913ce69ec65aa055a733923b0fc4659e1a0811a917c4dc93156d56a671bcfb25

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