This is a maintenance fork of libuhttpd
 
 
 
Go to file
Jianhui Zhao 84b4d2cdb5 Optimize code
Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
2017-11-12 16:48:29 +08:00
cmake/Modules Begin support ssl 2017-11-09 18:05:32 +08:00
example Optimize code for example 2017-11-12 15:11:39 +08:00
src Optimize code 2017-11-12 16:48:29 +08:00
.gitignore New script used to automatically generate SSL certificate files 2017-11-11 17:10:22 +08:00
CMakeLists.txt Basically complete SSL support: Optional OpenSSL and CyaSSl(wolfssl) 2017-11-10 18:51:49 +08:00
CONTRIBUTING.md Update README 2017-11-10 19:16:47 +08:00
CONTRIBUTORS.md Update README 2017-11-10 19:16:47 +08:00
LICENSE Initial commit 2017-11-04 17:30:20 +08:00
README.md Update README 2017-11-12 16:28:09 +08:00
gen_cert.sh New script used to automatically generate SSL certificate files 2017-11-11 17:10:22 +08:00
openssl.cnf New script used to automatically generate SSL certificate files 2017-11-11 17:10:22 +08:00

README.md

libuhttp

A very tiny and fast HTTP library based on libev and http-parser for Embedded Linux.

Keep Watching for More Actions on This Space

Features

  • use libev as its event backend
  • tiny and fast
  • SSL support: Optional OpenSSL and CyaSSl(wolfssl)
  • flexible and you can easily extend your application to have HTTP/HTTPS services

Why use libev as its backend?

libev tries to do one thing only (POSIX event library), and this in the most efficient way possible. Libevent tries to give you the full solution (event lib, non-blocking I/O library, http server, DNS client).

libev tries to follow the UNIX toolbox philosophy of doing one thing only, as good as possible.

Build on Ubuntu

Install dependency Tools and Libraries

~$ sudo apt install cmake libev-dev libhttp-parser-dev libssl-dev libwolfssl-dev

Clone the repository

~$ git clone https://github.com/zhaojh329/libuhttp.git
~$ cd libuhttp

Create the build directory

~/libuhttp$ mkdir build
~/libuhttp$ cd build

Configure

See which configuration are supported

~/libuhttp/build$ cmake .. -LH

Default configure: automatically select the SSL library as its SSL backend(If there is a SSL library available).

~/libuhttp/build$ cmake ..

Disable SSl support

~/libuhttp/build$ cmake .. -DUHTTP_DISABLE_SSL=1

Explicit use OpenSSL as its SSL backend

~/libuhttp/build$ cmake .. -DUHTTP_USE_OPENSSL=1

Explicit use CyaSSl(wolfssl) as its SSL backend

~/libuhttp/build$ cmake .. -DUHTTP_USE_CYASSL=1

Build and install libuhttp

~/libuhttp/build$ make && sudo make install

Run the Example

First generate the SSL certificate file

~/libuhttp/build$ cd ..
~/libuhttp$ ./gen_cert.sh

Run

~/libuhttp$ ./build/example/helloworld

Then use the command curl or browser to access https://127.0.0.1:8000/test

$ curl -k https://127.0.0.1:8000/test -v

Example

Contributing

If you would like to help making libuhttp better, see the CONTRIBUTING.md file.

Thanks for the following project

If the project is helpful to you, please do not hesitate to star. Thank you!