Use start_server() with websocket? #9158
-
I was wondering if it's possible to set up a websocket connection with a server that has been started using Code examples explaining how to use |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I assume you are talking about Second, I am pretty sure you need at least a minimal HTTP server capable of "promoting" a HTTP connection to a websocket connection. |
Beta Was this translation helpful? Give feedback.
-
I have an example here: https://github.com/marcidy/micropython-uasyncio-websockets with examples of use here: https://github.com/marcidy/micropython-uasyncio-webexample. websockets.server.serve uses uasyncio.start_server. You'll need the protocol to be asyncio compatible as well, which that repo provides. |
Beta Was this translation helpful? Give feedback.
I have an example here: https://github.com/marcidy/micropython-uasyncio-websockets with examples of use here: https://github.com/marcidy/micropython-uasyncio-webexample.
websockets.server.serve uses uasyncio.start_server. You'll need the protocol to be asyncio compatible as well, which that repo provides.