µWebSockets.py™ (it's "micro") is simple, secure[1] & standards compliant[2] web I/O for the most demanding[3] of applications.
• For JavaScript • User manual • Docs
© 2016-2019, >39,632,272 downloads
µ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()
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.
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.
µ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.