pfalcon / picoweb

Really minimal web application framework for the Pycopy project (minimalist Python dialect) and its "uasyncio" async framework
https://github.com/pfalcon/pycopy
MIT License
510 stars 99 forks source link

Websockets support #43

Open iBobik opened 5 years ago

iBobik commented 5 years ago

Is there some hack how to start websockets endpoint on some path?

pfalcon commented 5 years ago

It's the same issue as in https://github.com/pfalcon/picoweb/issues/42 . Both TLS and Websockets are wrapper (or stacked) protocols on top of TCP (and can wrap each other too, e.g. websocket -> TLS -> TCP). Handling that efficiently is an open issue in uasyncio framework.

Actually, I did some initial-prototype, subject-to-change websocket implementation for uasyncio: https://github.com/pfalcon/micropython-lib/tree/master/uasyncio.websocket.server

Where I stopped IIRC is exactly at integrating it with picoweb, e.g. to proceed with the implementation of https://github.com/pfalcon/uremi .

You're welcome to play with that stuff.

iBobik commented 5 years ago

Could be helpful: https://github.com/hiway/micropython-uasyncio-uwebsockets-modules