uasyncio.websocket.server import websocket
I like to use the uasyncio.websocket.server implementation but there is an import for websockets package defined. Where can I find this package?
uasyncio.websocket.server compatibility with websocket clients
server.py does not work with every clients. For instance CPython websockets client https://pypi.org/project/websockets/
I have made some experiments https://forum.micropython.org/viewtopic.php?f=15&t=6568&p=37374#p37374 and found that there is already some modifications to uncomment to enable compatibility with this client, plus pycopy port unable this modifications, with some explanation in the last PR. https://github.com/pfalcon/pycopy-lib/commit/3803ff6ad7156dee9575f1c921f4df3fa2bdc117
Is there a reason why it is not enabled ? does it broke compatibility with some other client ?
In this case could it be possible to selectively enable it depending the connected client?
That is because server.py imports websocket instead of uwebsocket.
Fix:
diff --git a/uasyncio.websocket.server/uasyncio/websocket/server.py b/uasyncio.websocket.server/uasyncio/websocket/server.py
index 046b071..d721fb5 100644
--- a/uasyncio.websocket.server/uasyncio/websocket/server.py
+++ b/uasyncio.websocket.server/uasyncio/websocket/server.py
@@ -1,6 +1,6 @@
import uasyncio
import uhashlib, ubinascii
-import websocket
+import uwebsocket as websocket