Git Product home page Git Product logo

webserver's Introduction

项目概述

该项目是一个简单的webServer,使用 epoll + threadpool 实现,支持GET、POST方法,可以实现html、jpg、png、ico、MP3、js、css等文件的解析,在POST方法的处理中使用CGI服务器进行计算并返回结果。

使用说明

该项目使用时,需要在目录中放置一个mp3文件,并命名为1.mp3,具体位置为webServer2.0目录下。使用make进行编译连接源文件,使用:./server port运行程序。其中,port为端口号。

以8080端口为例,终端输入:

./server 8080

打开浏览器,输入:

localhost:8080

即可看到网页显示。

版本说明

  • test.cpp为最初版本,使用 epoll + 多线程 实现,可以完成基础功能,支持GET方法,可传输html、jpg、png、mp3
  • webServer1.0使用 threadpool 实现,支持GET、POST方法,可以解析html、jpg、png、ico、MP3、js、css等,并加入了CGI服务器,可以稳定运行
  • webServer2.0使用 epoll + threadpool实现,支持GET、POST方法,可以解析html、jpg、png、ico、MP3、js、css等,使用CGI服务器进行数据的计算并返回网页给浏览器,可以稳定运行

webserver'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.