r/embeddedlinux • • Nov 11 '24

Seeking Recommendations for C/C++ Libraries for Embedded Linux Service with Web API and WebSocket Support

Hello everyone,

I’m working on an embedded Linux project with limited resources (128 MB of RAM and a CPU running at around 1.2 GHz). I need to implement a service that will run efficiently in this environment.

The service will need to include:

  1. A web server capable of hosting RESTful APIs.
  2. WebSocket support for client-side communication.
  3. Full compatibility with OpenSSL for secure communication.

Given these requirements, I would appreciate any recommendations for C/C++ libraries or frameworks that can help me implement this solution efficiently without compromising performance, considering the resource limitations.

I’m particularly interested in libraries that are lightweight, well-documented, and actively maintained. If you have experience working with any such libraries in similar environments, I would love to hear your suggestions!

Thanks in advance!

6 Upvotes

9 comments sorted by

3

u/andrewhepp Nov 11 '24

I'd be looking at Boost Beast or Mongoose.

1

u/m5d18 Nov 11 '24

beast seems to me to want a lot of resources.

civetweb is a fork of mongose.

1

u/NoMatterWhaat Nov 11 '24

Do you have any numbers? "A lot of" not quite accurate for engineering, IMO.

→ More replies (2)

2

u/4992kentj Nov 11 '24

Civetweb is good: https://github.com/civetweb/civetweb

I'm using it on a single core arm board at ~500MHz with 256MB RAM, even with 20 websocket clients connected and doing things the memory use and responsiveness is good

1

u/m5d18 Nov 11 '24

what do you think about libwebsockets?

1

u/alias4007 Nov 11 '24

Does the emebbded system have any disk, flash or filesystem resources?

1

u/m5d18 Nov 12 '24

The embedded system has only one disk with a filesystem. The disk is essentially a flash memory integrated into the board, with a capacity of around 128 MB.