Add `WebSocketsSansIOProtocol`
@aaugustin Do you have availability to review this in the next days?
Seems like I need to drop Python 3.8 to make my life easier. 👀
I'm making a note to look into it tomorrow. If I don't find time tomorrow, then I'll do over the Christmas break.
Hi! I'm just leaving a comment to say that I'm running into the issue this fixes, and I'm greatly anticipating this being merged. Let me know if there's anything I can do to help.
Is there any hope this PR could be finished/merged? 😅
Is there any hope this PR could be finished/merged? 😅
It's going to happen at some point. No ETA. Not much needed to finish this PR tho.
Funny. I am at PyCon SG and I heard a talk about flet yesterday. Nice stuff! 😁
I don't understand why your project has both hypercorn and Uvicorn as dependencies tho.
Ah, great! :)
I don't understand why your project has both hypercorn and Uvicorn as dependencies tho.
Good catch, it was probably added during the testing of some options. Flet uses Uvicorn as a built-in web server and it's awesome.
@aaugustin Pipeline is passing. Do you have time to give a last look? (also, sorry for the delay)
Things that I skip in this PR:
- We are not testing
CONTframes. - We are not testing when there's a parser issue.
I'd like to have those 2 points tested, but I don't want to spend more time in this to have this merged.
I also think that WebSockets merits more documentation in Uvicorn.
Besides that, I checked all the comments above, and none of them seem to block this PR to get merged (correct me if wrong @aaugustin).
I will have a look this week-end.
We are not testing CONT frames.
They're uncommon in real life and your implementation is simple enough that it's probably right :-)
If you want to do a quick manual test, you can run this:
import asyncio
from websockets.asyncio.client import connect
async def fragmented_hello():
async with connect("<address of echo server built with uvicorn>") as websocket:
await websocket.send(["Hell", "o!"])
await websocket.recv()
if __name__ == "__main__":
asyncio.run(hello())
We are not testing when there's a parser issue.
The parser is hardened and quite hard to crash. oss-fuzz has been trying to crash if for several years now (https://github.com/python-websockets/websockets/blob/main/fuzzing/fuzz_websocket_parser.py) and hasn't crashed it yet.