All Projects → ksenginew → WSocket

ksenginew / WSocket

Licence: MIT license
Simple WSGI HTTP + Websocket Server, Framework, Middleware And App.

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to WSocket

plaster
Application config settings abstraction layer.
Stars: ✭ 19 (+0%)
Mutual labels:  wsgi
palace
server side framework for dart inspired by express.js
Stars: ✭ 32 (+68.42%)
Mutual labels:  handler
uwsgiconf
Configure uWSGI from your Python code
Stars: ✭ 75 (+294.74%)
Mutual labels:  wsgi
defense
🔮 A Crystal HTTP handler for throttling, blocking and tracking malicious requests.
Stars: ✭ 51 (+168.42%)
Mutual labels:  handler
router
Fast router for PSR-15 request handlers
Stars: ✭ 18 (-5.26%)
Mutual labels:  handler
a2wsgi
Convert WSGI app to ASGI app or ASGI app to WSGI app.
Stars: ✭ 78 (+310.53%)
Mutual labels:  wsgi
flask-redis-docker
A minimal template for dockerized flask app with redis task queue
Stars: ✭ 49 (+157.89%)
Mutual labels:  wsgi
jwt-session
JwtSession is a PHP session replacement. Instead of use FileSystem, just use JWT TOKEN. The implementation follow the SessionHandlerInterface.
Stars: ✭ 42 (+121.05%)
Mutual labels:  handler
django-http-exceptions
HTTP exceptions for django
Stars: ✭ 29 (+52.63%)
Mutual labels:  wsgi
Android-System-Related-Charts
各种与Android系统相关的框架图、流程图
Stars: ✭ 52 (+173.68%)
Mutual labels:  handler
wsgi lineprof
WSGI middleware for line-by-line profiling
Stars: ✭ 47 (+147.37%)
Mutual labels:  wsgi
monolog-telegram-handler
Monolog handler to send log by Telegram
Stars: ✭ 32 (+68.42%)
Mutual labels:  handler
sensu-influxdb-handler
Sensu Go InfluxDB Metrics Handler
Stars: ✭ 14 (-26.32%)
Mutual labels:  handler
secure-cookie
Secure cookies and sessions for WSGI
Stars: ✭ 30 (+57.89%)
Mutual labels:  wsgi
CoreLooper
No description or website provided.
Stars: ✭ 34 (+78.95%)
Mutual labels:  handler
HandlerFrame
🐮 HandlerFrame是一个基于观察者模式采用信息分发机制实现跨界面Handler通讯框架,整个项目里面只存在一个Handler实例对象。
Stars: ✭ 42 (+121.05%)
Mutual labels:  handler
next-test-api-route-handler
🚀✨ Confidently unit test your Next.js API routes/handlers in an isolated Next.js-like environment
Stars: ✭ 150 (+689.47%)
Mutual labels:  handler
xml-spac
Handle streaming XML data with declarative, composable parsers
Stars: ✭ 39 (+105.26%)
Mutual labels:  handler
gonreli
use go http handlers in nodejs
Stars: ✭ 14 (-26.32%)
Mutual labels:  handler
koa-better-error-handler
A better error-handler for Lad and Koa. Makes `ctx.throw` awesome (best used with koa-404-handler)
Stars: ✭ 51 (+168.42%)
Mutual labels:  handler

Downloads GitHub issues GitHub forks GitHub stars GitHub license Twitter


Logo

WSocket

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

Explore the docs »

PyPI · Report Bug · Request Feature

About The Project

This is a simple library to add websocket support to WSGI.

  • Server - Patched wsgiref server
  • Middleware - Add websocket support to Flask, Django, Pyramid, Bottle, ...
  • Handler - Websocket handler to wsgiref
  • Framework - Basic websocket + WSGI web application framework
  • App - Plug and play demo app.

Getting Started

This is an example of how you may give instructions on setting up your websocket connunication locally.

Installation

You can

  • Installing from PyPI
  • Download:down_arrow: and Include

Installing from PyPI

Install latest version or upgrade an already installed WSocket to the latest from PyPI.

pip install --upgrade wsocket

Download and Include

  • Visit wsocket.py.
  • Save file (ctrl+s in browser).
  • Include in your package derectory.
    my-app/
    ├─ hello_world.py
    ├─ wsocket.py

Usage

  • Include following source on your test file(eg:-hello_world.py).
from wsocket import WSocketApp, WebSocketError, logger, run
from time import sleep

logger.setLevel(10)  # for debugging

def on_close(self, message, client):
    print(repr(client) + " : " + message)

def on_connect(client):
    print(repr(client) + " connected")

def on_message(message, client):
    print(repr(clent) + " : " + repr(message))
    try:
        client.send("you said: " + message)
        sleep(2)
        client.send("you said: " + message)

    except WebSocketError:
        pass

app = WSocketApp()
app.onconnect += on_connect
app.onmessage += on_message
app.onclose += on_close

run(app)
  • Visit client.html.
  • Save file (ctrl+s in browser).
  • Open it in browser(websocket supported).
  • Experience the two way websocket communication. 😄😄😄

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

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

Contact

View Documentaion - https://wsocket.gitbook.io/

Report Bugs - https://github.com/Ksengine/WSocket/issues/new/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].