← index #348Issue #355
Related · high · value 4.151
QUERY · ISSUE

uasyncio.websocket.server import websocket

openby mrwhy-origopened 2019-08-23updated 2019-09-08

I like to use the uasyncio.websocket.server implementation but there is an import for websockets package defined. Where can I find this package?

1 comment
jomasnash · 2019-09-08

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

CANDIDATE · ISSUE

uasyncio.websocket.server compatibility with websocket clients

openby pidou46opened 2019-09-25updated 2019-09-25

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?

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied