/uWebSockets.py

µWebSockets for Python 3 [WIP]

Primary LanguageC++Apache License 2.0Apache-2.0

Update 2020-06-16 I'm still considering this project. All technical issues are solved and we experience incredibly nice performances so the remaining parts are wrapping up everything and polishing it for release. I'm not going to start on that until other things I have prioritized are done. So this means the project will be idle for a few months, and then I'll hopefully finish this thing up.

You can help by letting people know about the project and showcase the performance.

µWebSockets.py™ (it's "micro") is simple, secure[1] & standards compliant[2] web I/O for the most demanding[3] of applications.

For JavaScriptUser manualDocs

© 2016-2019, >39,632,272 downloads

In a nutshell

µWebSockets.py is a secure & standards compliant Http & WebSockets server with router & pubsub support built in. It is significantly faster than both Japronto & Bjoern and has been available to JavaScript developers since 2016. It is written entirely in C++ and integrates seamlessly with any asyncio project by plugging the elegant Python interpreter with its own Selector implementation. It currently runs on Linux & macOS.

import uws
import asyncio

# Integrate with asyncio
asyncio.set_event_loop(uws.Loop())

app = uws.App({
        "some": "option"
})

def getHandler(res, req):
	res.end("Hello Python!")

app.get("/*", getHandler)

def listenHandler():
        print("Listening to port 3000")

app.listen(3000, listenHandler)

# Run asyncio event loop
asyncio.get_event_loop().run_forever()

Ready all thrusters

  • pip install uws no compiler needed, no dependencies. Integrates seamlessly with Python 3.6+ asyncio.

For a performance reference, consider Japronto performance graph, then the above graph. We are significantly faster than both Japronto and Bjoern, while also being much more feature complete and secure.

Pay what you want.

Commercially developed on a sponsored/consulting basis; BitMEX, Bitfinex and Coinbase are current or previous sponsors. Contact me, the author for support, feature development or consulting/contracting.

Know thy legal matters.

µWebSockets.py is intellectual property licensed Apache 2.0 with limitations on trademark use. Forks must be clearly labelled as such and must not be confused with the original.