Skip to main content

Simple WSGI Websocket Server, Framework, Middleware And App

Project description

WSocket

Simple WSGI HTTP + Websocket Server, Framework, Middleware And App.

Downloads

Note: I am a 16 years old student.I have no enough knowledge. So can anyone help me to develop this library?

Server

Server(WSGI) creates and listens at the HTTPsocket, dispatching the requests to a handler. WSGIRef server but uses threads to handle requests by using the ThreadingMixIn. This is useful to handle web browsers pre-opening sockets, on which Server would wait indefinitely. can used with any WSGI compatible web framework

Middleware

convert any WSGI compatible web framework to Websocket+HTTP framework using middleware. works with many WSGI compatible servers can used with any WSGI compatible web framework

Flask, Django, Pyramid, Bottle, ... supported

Handler

wsgiref.simple_server.WSGIRequestHandler like class named FixedHandler that always wrap WSGI app using Middleware. changes from WSGIRequestHandler :

  • Prevents reverse DNS lookups
  • errorless logger
  • use ServerHandler to make it WSGI

You can convert wsgiref to a websocket+HTTP server using this handler

ServerHandler

wsgiref.simple_server.ServerHandler(inherited from wsgiref.handlers.ServerHandler like handler named FixedServerHandler . changes from ServerHandler :

  • set HTTP version to 1.1 because versions below 1.1 are not supported some clients like Firefox.
  • removed hop-by-hop headers checker because it raise errors on Upgrade and Connection headers
  • check that all headers are strings

Framework

basic WSGI web application framework that uses Middleware.

  • simple routes handler
  • auto description to status code
  • headers checker
  • send data as soon as possible
  • send strings, bytes, lists(even bytes and strings mixed) or files directly
  • error catcher and error logger

works with many WSGI compatible servers

App

Event based app for websocket communication. this is app that uses Framework if not events handled by developer. this app works like demo(echo) app.

Features

all Middleware, Handler, Framework and App has following features.

  • websocket sub protocol supported
  • websocket message compression supported (works if client asks)
  • receive and send pong and ping messages(with automatic pong sender)
  • receive and send binary or text messages
  • works for messages with or without mask
  • closing messages supported
  • auto and manual close

View Documentaion - https://wsocket.gitbook.io/ Report Bugs - https://github.com/Ksengine/WSocket/issues/new/

License

Code and documentation are available according to the MIT License (see LICENSE).

Download files

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

Source Distribution

WSocket-2.0.2.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

WSocket-2.0.2-py2.py3-none-any.whl (16.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file WSocket-2.0.2.tar.gz.

File metadata

  • Download URL: WSocket-2.0.2.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/2.7.16

File hashes

Hashes for WSocket-2.0.2.tar.gz
Algorithm Hash digest
SHA256 256ca10d234dba0e2192c7b7fc4071920f6e130e021bc5ab3459d3086e6e1d96
MD5 e331ac7b9695e3d323f539f9216e3343
BLAKE2b-256 55b632a06c6f9496832e85808e267deb03a99f1ddb0cd867164a3aebf1051840

See more details on using hashes here.

File details

Details for the file WSocket-2.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: WSocket-2.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/2.7.16

File hashes

Hashes for WSocket-2.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 195389699f789e5daf3c0623074256f717ad37e0648269126aad771ebd279ecd
MD5 9b767d951604890a7e7b5c9acca273f1
BLAKE2b-256 511ff497cf4a01ac64c4aa4bcaa154550af5e95ef4d5c2f17922cc7127d9daf8

See more details on using hashes here.

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