{"id":19347259,"url":"https://github.com/tinoryj/simplehttpserver_epoll_threadpoll","last_synced_at":"2025-02-24T09:43:55.065Z","repository":{"id":115603593,"uuid":"89911676","full_name":"tinoryj/SimpleHTTPServer_epoll_threadPoll","owner":"tinoryj","description":"C++ HTTPServer with epoll \u0026 thread pool","archived":false,"fork":false,"pushed_at":"2018-03-23T07:48:36.000Z","size":14023,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-06T14:35:34.479Z","etag":null,"topics":["cpp","epoll","httpserver"],"latest_commit_sha":null,"homepage":"","language":"TeX","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tinoryj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-01T09:21:23.000Z","updated_at":"2022-07-20T13:24:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"1ab2cedd-4365-4d5e-819a-61de6e708025","html_url":"https://github.com/tinoryj/SimpleHTTPServer_epoll_threadPoll","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinoryj%2FSimpleHTTPServer_epoll_threadPoll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinoryj%2FSimpleHTTPServer_epoll_threadPoll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinoryj%2FSimpleHTTPServer_epoll_threadPoll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinoryj%2FSimpleHTTPServer_epoll_threadPoll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinoryj","download_url":"https://codeload.github.com/tinoryj/SimpleHTTPServer_epoll_threadPoll/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240457940,"owners_count":19804489,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","epoll","httpserver"],"created_at":"2024-11-10T04:15:12.511Z","updated_at":"2025-02-24T09:43:55.044Z","avatar_url":"https://github.com/tinoryj.png","language":"TeX","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Introduction\nUniversity of Electronic Science and Technology 2017 Comprehensive Course Design Topics.\n## Topic Requirements:\n\u003e Implement a simple web server and implement the relevant request handling mechanism\n\n\u003e (1) Learn to understand the HTTP protocol principles and protocol formats;\n\n\u003e (2) Designing a Web server: (a) Developing a multi-threaded server communication program that can receive remote data, each thread corresponding to a TCP link; (b) Defining the HTTP request/response data transmission format; (c) Developing a data parsing module (d) Develop server handlers corresponding to HTTP methods such as GET and POST; (e) Send a response message to the client upon completion of the request message processing, and send a corresponding error response if the server error occurs.\n\n\u003e (3) Use a web browser to test the server and demonstrate it online.\n\n## Implementation\n\nEpoll + thread pool\n## other demands\n\nThe boost library needs to be installed. Since Epoll is used, it must be run under a Linux system.\n\nUsing Ubuntu as an example, you can use the following command to install the boost library.\n\n```\nSudo apt-get install libboost-dev\n```\n## usage instructions\nSet the server file path in the httpServer.cpp file: absolute path, as shown below\n\n```C++\nConst char HttpServe::rootDir_[] = \"/home/tinoryj/Documents/Code/Server/webSrc\";\n```\n\nAt the same time, set the home page file name as follows:\n\n```C++\nConst char HttpServe::homePage_[] = \"index.html\";\n```\n\nAfter setting the file path in httpServer.cpp, set the number of thread pool threads in webEpollThreadPool.cpp. (can be ignored)\n\nAfter entering the project folder, you can directly use the *make* directive to complete the build link and generate the executable file webEpollThreadPool.\nThe port number needs to be added at startup, as shown below:\n\n```\nSudo ./webEpollThreadPool 80\n```\nor\n\n```\n./webEpollThreadPool 8080\n```\n\nSpecify the port number, and use *sudo* to open the port in the range of 0-1023.\n\n\n===============================================================================\n\n# 工程简介\n电子科技大学2017年综合课程设计题目。\n## 题目要求：\n\u003e 实现一简单的Web服务器，并实现相关的请求处理机制\n\n\u003e (1)学习理解HTTP协议原理及协议格式；\n\n\u003e (2)设计Web服务器：（a）开发多线程服务器通信程序，可接收远程数据，每个线程对应一个TCP链接；（b)定义HTTP请求/响应数据传输格式；（c）开发数据解析模块；（d）开发与HTTP的GET和POST等方法对应的服务器处理程序；（e）根据请求报文处理完成后，发送响应报文到客户端，若服务器出错也发送相应错误响应。\n\n\u003e(3)利用Web浏览器测试服务器，并可在线演示。\n\n## 实现方法\n\nEpoll + 线程池\n## 其他需求\n\n需要安装boost库，由于使用Epoll，必须在Linux系统下运行。\n\n以Ubuntu为例，可使用如下命令安装boost库。\n\n```\nsudo apt-get install libboost-dev\n```\n## 用法说明\n在httpServer.cpp文件中设置服务器文件路径：绝对路径，如下所示\n\n```C++\nconst char HttpServe::rootDir_[] = \"/home/tinoryj/Documents/Code/Server/webSrc\";\n```\n\n同时，设置主页文件名，如下所示：\n\n```C++\nconst char HttpServe::homePage_[] = \"index.html\";\n```\n\n在httpServer.cpp中设置文件路径后，在webEpollThreadPool.cpp中设置线程池线程数。（可无视）\n\n在进入工程文件夹后，可直接使用*make*指令完成编译链接，生成可执行文件webEpollThreadPool。\n启动时需要添加端口号，如下所示：\n\n```\nsudo ./webEpollThreadPool 80\n```\n或\n\n```\n./webEpollThreadPool 8080\n```\n\n其中端口号请自行指定，使用时若要开启0-1023范围内的端口，请使用*sudo*。\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinoryj%2Fsimplehttpserver_epoll_threadpoll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinoryj%2Fsimplehttpserver_epoll_threadpoll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinoryj%2Fsimplehttpserver_epoll_threadpoll/lists"}