← index #348Issue #8177
Off-topic · high · value 4.395
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

Simple example of uasyncio WebSocket Server (secure - with SSL)

closedby beyonloopened 2022-01-14updated 2026-03-19

Hi all.

I would like a simple example of uasyncio WebSocket Server (secure - with SSL). I see that there is a official uwebsocket module implemented on MicroPython.

>>> import os
>>> os.uname()
(sysname='esp32', nodename='esp32', release='1.17.0', version='v1.17 on 2021-09-02', machine='ESP32 module (spiram) with ESP32')
>>> import uwebsocket
>>>

Well, so I found a example (https://github.com/micropython/micropython/blob/master/extmod/webrepl/webrepl.py) that use the official uwebsocket module. Need just to add SSL + uasyncio on that example.

Thank you in advance!

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