All Projects → chendotjs → Lotos

chendotjs / Lotos

Licence: mit
tiny but high-performance HTTP Server

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Lotos

fancy
High performance web server
Stars: ✭ 20 (-85.71%)
Mutual labels:  http-server, epoll, network-programming
Tkeed
🌎 High Performance HTTP WebServer
Stars: ✭ 485 (+246.43%)
Mutual labels:  epoll, network-programming, nginx
Zaver
Yet another fast and efficient HTTP server
Stars: ✭ 673 (+380.71%)
Mutual labels:  epoll, nginx, http-server
Webserver
A C++ Lightweight Web Server based on Linux epoll
Stars: ✭ 135 (-3.57%)
Mutual labels:  epoll, network-programming
WebServer
High-performance multi-threaded tcp network server in c++11
Stars: ✭ 58 (-58.57%)
Mutual labels:  http-server, epoll
connect
tiny cross-platform socket API library
Stars: ✭ 46 (-67.14%)
Mutual labels:  epoll, network-programming
malloy
A C++ library providing embeddable server & client components for both HTTP and WebSocket.
Stars: ✭ 29 (-79.29%)
Mutual labels:  http-server, network-programming
BCA-Phantom
A multi-platform HTTP(S) Reverse Shell Server and Client in Python 3
Stars: ✭ 80 (-42.86%)
Mutual labels:  http-server, network-programming
toyhttpd
I/O 模型练手代码,分别使用阻塞式 I/O、select、poll 和 epoll 和 Java NIO 实现了简单的 HTTP Server
Stars: ✭ 43 (-69.29%)
Mutual labels:  http-server, epoll
Facebooc
Yet another Facebook clone written in C
Stars: ✭ 483 (+245%)
Mutual labels:  epoll, http-server
Mongols
C++ high performance networking with TCP/UDP/RESP/HTTP/WebSocket protocols
Stars: ✭ 250 (+78.57%)
Mutual labels:  epoll, http-server
Gev
🚀Gev is a lightweight, fast non-blocking TCP network library based on Reactor mode. Support custom protocols to quickly and easily build high-performance servers.
Stars: ✭ 1,082 (+672.86%)
Mutual labels:  epoll, network-programming
Libhv
🔥 比libevent、libuv更易用的国产网络库。A c/c++ network library for developing TCP/UDP/SSL/HTTP/WebSocket client/server.
Stars: ✭ 3,355 (+2296.43%)
Mutual labels:  http-server, epoll
Mgx
🌈 A high performance network framework written in c++ (support tcp and http)
Stars: ✭ 15 (-89.29%)
Mutual labels:  http-server, epoll
Webserver
A C++ High Performance Web Server
Stars: ✭ 4,164 (+2874.29%)
Mutual labels:  epoll, http-server
Webcpp
用C++开发web服务器框架
Stars: ✭ 23 (-83.57%)
Mutual labels:  epoll, http-server
Envelop.c
🌊 Thread-less, event-loop based tiny http-server from scratch using epoll. Learning Purpose.
Stars: ✭ 75 (-46.43%)
Mutual labels:  epoll, http-server
Webapp.rs
A web application completely written in Rust. 🌍
Stars: ✭ 1,888 (+1248.57%)
Mutual labels:  http-server
Docker Flask Gunicorn Nginx
Bootstrap example of a Flask app served via Gunicorn and Nginx using Docker conteiners
Stars: ✭ 138 (-1.43%)
Mutual labels:  nginx
Robohydra
Testing tool for HTTP-based-API clients
Stars: ✭ 133 (-5%)
Mutual labels:  http-server

Lotos WebServer

Build Status

Lotos is a tiny but high-performance HTTP WebServer following the Reactor model, using non-blocking IO and IO multiplexing(epoll ET) to handle concurrency. Lotos is written in pure c and well tested. Several HTTP headers (Connection, Content-Length, etc.) is supported and more will be added in the future.

-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
C                               19            367            275           2428
C/C++ Header                    12            120            131            514
make                             2             17              0             42
CMake                            1              7              0             18
-------------------------------------------------------------------------------
SUM:                            34            511            406           3002
-------------------------------------------------------------------------------

Documents

0x01 0x02 0x03 0x04 0x05 0x06
项目目的 并发模型 设计实现 测试调试 性能测试 调试记录

Environment

  • gcc >= 5.4 or clang >= 3.5 (gcc4.9 is not supported)
  • Linux only, kernel version >= 3.9

Usage

Build

$ git clone https://github.com/chendotjs/lotos.git
$ cd lotos/src/
$ make && make test

Run

Usage: lotos -r html_root_dir [-p port] [-t timeout] [-w worker_num] [-d (debug mode)]

$ ./lotos -r ../www -t 60 -w 4 -p 8888

then you can visit http://localhost:8888/.

Feature

  • EPOLL Edge Trigger mode, more efficient.
  • Nonblocking IO.
  • Multiprocessing, port reuse.
  • TCP connections managed by min-heap data structure.
  • HTTP persistent connection support. Close TCP connection when connection expires.
  • Parse HTTP requests using FSM.
  • Handle errors and exceptions.
  • Memory pool is optional.

Test

Unit tests are based on minctest. It is simple, lightweight, and flexible.

Moreover, I contributed some codes to it.

Benchmark

Please refer to BENCHMARK.md.

Reference

nginx

node.js http parser

Tkeed

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].