GNU libmicrohttpd 1.0 Released - The Web For IoT |
Written by Harry Fairhead | |||
Monday, 05 February 2024 | |||
The IoT is very dependent on web technologies, but for many applications the software needed is excessive. libmicrohttp is a small C library that lets you add HTTP to your C programs.
The big problem with the web is that it has evolved to the point where its protocols are difficult to implement if you have to do it from scratch. It is only relatively recently that we have been able to select devices that are powerful enough to run a desktop operating system for IoT or embedded tasks. Having an operating system can make things more difficult for basic tasks that involve accurate timing, but having high-level features like files and graphics make things easier. There are areas where its more difficult to decide how to proceed. For example, what should an IoT program that wants to expose a web interface do? One possiblity is to use a full web server like Apache, but in many cases this is not only overkill but a security risk. If all your IoT program wants to do is send a few static pages with some dynamically generated content then having a full web server is a nightmare to configure properly. HTTP is simple enough to implement on your own server or client, but it quickly becomes difficult to keep up with the possible headers that could be in use and it gets difficult when you throw in HTPPS or anything to do with encryption. For small devices that don't run a desktop operating system there are some libraries that provide basic HTTP and even encryption, but for desktop machine, there is a general assumption that you might as well install a full server. If you don't want to do this then there are few obvious C libraries that will do the job. One such was libmicrohttpd, a GNU project, but it was looking a little neglected until recently Now we have a version 1.0 release and a promise of more activity. The stated good points of the release are:
At 32k it is certainly small enough to use on an IoT device. It is easy to use and you can use it to serve multiple requests in different threading modes. If you want to use encryption then you need an additional package. At the moment only libgnutls is supported, but this does seem to be under active development. The even better news is that the there are plans to develop it further: Work will now begin work on a 2nd major version of GNU libmicrohttpd.This version will have an easier to use API, add support for HTTP2 and HTTP3, as well as multiple TLS backends. My only observation is that in today's climate separating HTTP and TLS libraries isn't really a good way to work. HTTPS is now so standard that we need any HTTP library to support HTTPS out of the box - not as an optional extra but as an optional disable. More InformationRelated ArticlesMaster The Pico WiFi: Simplest HTTPS Client Google Chrome Will Enforce HTTPS By Default ESP32 In MicroPython: Client Sockets To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.
Comments
or email your comment to: comments@i-programmer.info
|
|||
Last Updated ( Monday, 05 February 2024 ) |