Announcement

Collapse
No announcement yet.

GNU's libmicrohttpd 0.9.55 Embeddable Web Server Released

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • GNU's libmicrohttpd 0.9.55 Embeddable Web Server Released

    Phoronix: GNU's libmicrohttpd 0.9.55 Embeddable Web Server Released

    A new release is now available of libmicrohttpd, the GNU project making it easy to run an HTTP web server as part of another application...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    PHP have a built-in web server.


    Python have a built-in web server.
    Source code: Lib/http/server.py This module defines classes for implementing HTTP servers. Availability: not Emscripten, not WASI. This module does not work or is not available on WebAssembly platf...


    .NET Core have Kestrel.


    I guess libmicrohttpd is for you if you use C. It doesn't support HTTP/2 but it shouldn't matter for embedded servers anyway.

    Comment


    • #3
      For C and C++ projects I tend to use mongoose httpd instead (https://github.com/cesanta/mongoose)

      It is very light, just one .c and one .h file unlike most bloated web libraries but also supports websockets and https. Actually, regardless of language I use, I tend to bind to mongoose because it is just so light. It has a commercial license and GPL duel license.

      As a side note, Cesanta (the same guys behind mongoose) also have a fantastic Javascript library (v9) which is easier to integrate than duktape for C99 projects and unlike Node.js isn't a bloated piece of crap

      I have given libmicrohttpd a go a while back but was put off by one thing... can anyone explain this weird hack on the example code (https://www.gnu.org/software/libmicrohttpd/):

      Code:
        if (&dummy != *ptr)
          {
            /* The first time only the headers are valid,
               do not respond in the first round... */
            *ptr = &dummy;
            return MHD_YES;
          }
      Made worse by the fact that this dummy variable is a static int, and they have specified to run the example threaded (MHD_USE_THREAD_PER_CONNECTION), so frankly this also seems like a bad idea.
      Last edited by kpedersen; 29 May 2017, 05:26 AM.

      Comment


      • #4
        Moongose is single-threaded.

        Comment


        • #5
          Originally posted by Brane215 View Post
          Moongose is single-threaded.
          Is that an issue? I don't think the hardware using this thing would benefit for multithreading as on average it's single-core microcontrollers.

          Comment


          • #6
            In some circumstances. libmicrohttpd can be used in scenarios that demand higher throughput, while moongoose seems to be for much smaller stuff, so it's not a no-brainer alternative.

            I am looking for simple server that can be tailored for my purpose and after quick glance through sources I like libmicrohttpd better.
            Yes, it has more than one source file, but that's because everything is neatly partitioned. moongoose has one looong c source, which isn't that much better.
            It might have compiled better, but now with -flto that shouldn't be an issue.
            Last edited by Brane215; 29 May 2017, 08:10 AM.

            Comment


            • #7
              Originally posted by Brane215 View Post
              In some circumstances. libmicrohttpd can be used in scenarios that demand higher throughput, while moongoose seems to be for much smaller stuff, so it's not a no-brainer alternative.
              Could you make an example?
              I can't think of more complex applications than an application's web interface or something mostly-single-user like that for such simple embedded web servers. Like for example Crelay application https://github.com/ondrej1024/crelay

              For actual web serving on low-end stuff I'd use nginx.

              Comment


              • #8
                For example, I plan to use it for my server that'l generate dynamic content from server itself, without php etc.
                Something that can punch above its weight but still have manageable source.

                Last edited by Brane215; 29 May 2017, 04:00 PM.

                Comment


                • #9
                  *grumble*

                  Article specifically mentions "for integration into other GPL applications", so I'm thinking it's GPL'd.

                  Not so. According to their website (https://www.gnu.org/software/libmicrohttpd/):
                  you can redistribute it and/or modify it under the GNU LGPL v2.1 or at your option any later version. If you disable HTTPS/SSL support, you can also choose the second license, the eCos License.
                  Michael, please be more careful when mentioning GPL. I'm glad I checked. I almost didn't.

                  Comment


                  • #10
                    Originally posted by uid313 View Post
                    PHP have a built-in web server.


                    Python have a built-in web server.
                    Source code: Lib/http/server.py This module defines classes for implementing HTTP servers. Availability: not Emscripten, not WASI. This module does not work or is not available on WebAssembly platf...


                    .NET Core have Kestrel.


                    I guess libmicrohttpd is for you if you use C. It doesn't support HTTP/2 but it shouldn't matter for embedded servers anyway.
                    The one in Python is a toy that you shouldn't ever let face the Internet. Dunno about the others

                    Comment

                    Working...
                    X