nodemcu / nodemcu-firmware

Lua based interactive firmware for ESP8266, ESP8285 and ESP32
https://nodemcu.readthedocs.io
MIT License
7.64k stars 3.12k forks source link

Working version of the websocket support #3514

Open pjsg opened 2 years ago

pjsg commented 2 years ago

Fixes #.

This is the websocket enhancement to the httpd implementation. Unfortunately, it doesn't actually work due to a bug in the IDF, but there is a fix, and I'm hopeful that it will get merged soon. https://github.com/espressif/esp-idf/issues/8596

pjsg commented 2 years ago

It still has debugging statement that I will remove once it works well.

pjsg commented 2 years ago

I'm having problems in deciding what the lifetime of the ws object should be. I suspect that it isn't right at the moment. It deserves more thought.

jmattsson commented 7 months ago

Any further thoughts on the ws object lifetime? Is the current state good enough?

pjsg commented 7 months ago

After more thought, I've fixed the lifetime problems. Also I got rid of a memory leak. This is good to go.

jmattsson commented 7 months ago

This turned out to be more effort than I'd expected, so I'm glad you tackled it instead of me :D

I haven't tried it out or done an in-depth code review, but if you reckon it's ready to go, I'm happy to go with that. I left one comment about the docs that you might want to check before merging, but other than that, it'd be good to get this functionality in!