Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Real time embeddable http server library required

Having looked at several available http server libraries I have not yet found what I am looking for and am sure I can't be the first to have this set of requirements.

I need a library which presents an API which is 'pipelined'. Pipelining is used to describe an HTTP feature where multiple HTTP requests can be sent across a TCP link at a time without waiting for a response. I want a similar feature on the library API where my application can receive all of those request without having to send a response (I will respond but want the ability to process multiple requests at a time to reduce the impact of internal latency).

So the web server library will need to support the following flow

1) HTTP Client transmits http request 1

2) HTTP Client transmits http request 2 ...

3) Web Server Library receives request 1 and passes it to My Web Server App

4) My Web Server App receives request 1 and dispatches it to My System

5) Web Server receives request 2 and passes it to My Web Server App

6) My Web Server App receives request 2 and dispatches it to My System

7) My Web Server App receives response to request 1 from My System and passes it to Web Server

8) Web Server transmits HTTP response 1 to HTTP Client

9) My Web Server App receives response to request 2 from My System and passes it to Web Server

10) Web Server transmits HTTP response 2 to HTTP Client

Hopefully this illustrates my requirement. There are two key points to recognise. Responses to the Web Server Library are asynchronous and there may be several HTTP requests passed to My Web Server App with responses outstanding.

Additional requirements are

  1. Embeddable into an existing 'C' application
  2. Small footprint; I don't need all the functionality available in Apache etc.
  3. Efficient; will need to support thousands of requests a second
  4. Allows asynchronous responses to requests; their is a small latency to responses and given the required request throughput a synchronous architecture is not going to work for me.
  5. Support persistent TCP connections
  6. Support use with Server-Push Comet connections
  7. Open Source / GPL
  8. support for HTTPS
  9. Portable across linux, windows; preferably more.

I will be very grateful for any recommendation

Best Regards

like image 847
Howard May Avatar asked Feb 09 '10 17:02

Howard May


2 Answers

You could try libmicrohttp.

like image 142
Andrew Aylett Avatar answered Oct 05 '22 23:10

Andrew Aylett


Use the Onion, Luke. This is lightweight and easy to use HTTP server library in C.

like image 27
puchu Avatar answered Oct 06 '22 01:10

puchu