danni / uwebsockets

Micropython websockets implementation
MIT License
192 stars 44 forks source link

Enhancement ssl websocket #6

Closed fakufaku closed 5 years ago

fakufaku commented 6 years ago

Hi, thanks for a great project!

I have added basic support to connect to secure websockets via the ussl module. There were also some minor changes to make here and there because of different api for ssl sockets compared to regular sockets (send and recv are not available and read and write need to be used instead).

I have also added commands in the Makefile to create the sub-directories and also clean up everything.

I'd be grateful if you review the code and let me know of fixes and modifications that would allow it to be merged.

Cheers!

fakufaku commented 6 years ago

Thank you for the feedback. I replied to the comments individually and posted an updated version.

fakufaku commented 6 years ago

Thanks. I added one extra small change which is to close the websockets at the end of examples/echo_websocket_org.py and examples/echo_ssl_websocket_org.py. I found out that opening more than one SSL socket on the ESP32 causes an out-of-memory error (this has been documented before). Thus, running twice the ssl example without closing the socket would crash the board.

fakufaku commented 5 years ago

@danni , ping 😄 Any chance you had time to review the changes ? Cheers!

danni commented 5 years ago

Sorry, I missed the notification for this. Done! Thanks!

fakufaku commented 5 years ago

No worries, thanks a lot!