Giter Site home page Giter Site logo

lamphttp's Introduction

Lamphttp HTTP服务

Lamphttp是使用c语言实现的http服务,目前市面上有非常多的http服务,比如大名鼎鼎的Nginx 那么对于Lamphttp存在的意义是什么呢?对于Lamphttp主要是为了理解了tcp/ip到http的中间 这一层的实现,说白了就是当作学习用的.

虽然Lamphttp是作为学习用的项目,但其中间也用到了很多linux的编程技术,对于理解linux编 程非常有帮助. 比如,整个项目采用了反应堆模式,让项目有相当的可扩展空间. 当然免不了还有 linux的多线程编程,实现了一个简单的线程池,对于各个线程之间的通信实现了一个channel, 当然最重要的是我们使用了epoll技术,让我们的服务支持高并发。下面是整个项目的架构图。

lamphttp image

安装编译

项目使用CMake来管理依赖,使用如下步聚就可以安装服务:

git clone https://github.com/seepre/lamphttp.git
cd lamphttp
mkdir build
cmake ../
make && make install

运行程序

./bin/lamp

如果没有安装cmake,可以使用如下命令安装:

# macOS
brew install cmake

# centOS
yum install cmake

# ubuntu
apt-get install cmake

lamphttp's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.