esp-wifi icon indicating copy to clipboard operation
esp-wifi copied to clipboard

Provide simple web server example

Open MabaKalox opened this issue 3 years ago • 4 comments

Consider adding simple web server to examples.

MabaKalox avatar Oct 03 '22 11:10 MabaKalox

I'm not aware of any no_std web servers available on crates.io so we will likely need to implement some web server ourselves, unless there is a package available which I've missed. @bjoernQ can correct me if I'm wrong about this.

I do agree though, eventually it would be nice to demonstrate this functionality.

jessebraham avatar Oct 03 '22 17:10 jessebraham

I mostly ask it, because I feel totally lost. And have no idea where to start. But for sure will send pull request... if manage to write something. BTW: smoltcp has an example which called server, but for now I am too dump to understand, what it actually does.

MabaKalox avatar Oct 03 '22 21:10 MabaKalox

I also don't know any no-std/no-alloc HTTP server but probably writing something very simple should be possible in a few lines of code. (While a real HTTP server is definitely a lot of code)

In general I think at least some example showing a TCP server would be good and something that "looks like" HTTP is probably convenient since it can be tested in a browser.

bjoernQ avatar Oct 04 '22 06:10 bjoernQ

I'm also looking for a HTTP server on an ESP32C3. With IDF / RTOS it is available. I'm wondering if it makes sense on no-std without having an async HAL and Wifi - and Embassy as an async application model. Interested to get other people's perspective.

taunusflieger avatar Oct 12 '22 10:10 taunusflieger

#95 adds an oversimplified example showing a single server-socket used to do something that "looks like" HTTP - a real HTTP server is definitely out-of-scope for this crate

bjoernQ avatar Dec 01 '22 14:12 bjoernQ

Closing since we now have an example using server sockets - as said a real HTTP server is out-of-scope for this crate

bjoernQ avatar Dec 01 '22 16:12 bjoernQ

Big thanks!

MabaKalox avatar Dec 04 '22 02:12 MabaKalox