{"id":13645572,"url":"https://github.com/Fugoes/Webe","last_synced_at":"2025-04-21T14:31:41.636Z","repository":{"id":119118351,"uuid":"100009880","full_name":"Fugoes/Webe","owner":"Fugoes","description":null,"archived":false,"fork":false,"pushed_at":"2018-07-18T04:38:55.000Z","size":78,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-02T01:25:31.916Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fugoes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-08-11T08:24:45.000Z","updated_at":"2020-05-10T15:51:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"d46d4eda-175a-457a-ab87-26847a1c88cf","html_url":"https://github.com/Fugoes/Webe","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fugoes%2FWebe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fugoes%2FWebe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fugoes%2FWebe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fugoes%2FWebe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fugoes","download_url":"https://codeload.github.com/Fugoes/Webe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223868380,"owners_count":17217077,"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":[],"created_at":"2024-08-02T01:02:37.495Z","updated_at":"2024-11-09T18:31:46.353Z","avatar_url":"https://github.com/Fugoes.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"# Webe\n\n## Introduction\n\n`Webe` is a web server. I wrote it to hand it in as homework... It uses event loop with non-blocking IO and epoll.\n\n## How to Build\n\n```bash\n# For Debian 9 with gcc-6.3.0\n$ apt install -y libboost-filesystem-dev\n$ git clone https://github.com/Fugoes/Webe.git\n$ cd Webe\n$ mkdir cmake\n$ cd cmake\n$ cmake ..\n$ make\n```\n\nTo get release version which run much faster, use `cmake -DCMAKE_BUILD_TYPE=Release ..` instead of `cmake ..`.\n\n## How to Use\n\n```bash\n$ cd Webe/cmake\n$ ./webectl\nUsage: webectl load-module \u003cmodule\u003e\n       webectl unload-module \u003cmodule\u003e\n       webectl list-server\n       webectl stop-server\n       webectl start-server \u003cprocesses\u003e [ OPTIONS ]\nwhere  OPTIONS = { -a \u003caddress\u003e | -p \u003cport\u003e }\n```\n\nYou could directly run `./webed` instead. By default, it will load all modules.\n\n## Demo\n\n```shell\n$ cd Webe/cmake\n$ ln -s ../example/static static\n$ ./webectl start-server 4 -a 0.0.0.0 -p 8080\n$ ./webectl list-server\n        PID\n ----------\n       1906\n       1907\n       1905\n       1908\n```\n\nNow browse `http://127.0.0.1:8080/info`.\n\nTo unload some module:\n\n```shell\n$ ./webectl unload-module info\n```\n\nNow browse `http://127.0.0.1:8080/info`, it shall be `404 Not Found`.\n\nTo stop all server:\n\n```shell\n$ ./webectl stop-server\n        PID  STATUS\n ---------- -------\n       1906 STOPPED\n       1907 STOPPED\n       1905 STOPPED\n       1908 STOPPED\n```\nYou could also do some benchmark with ab from Apache2:\n\n```shell\n$ ab -k -n 1000000 -c 100 http://127.0.0.1:8080/static/nice.css\n...\nConcurrency Level:      100\nTime taken for tests:   7.025 seconds\nComplete requests:      1000000\nFailed requests:        0\nNon-2xx responses:      1000000\nKeep-Alive requests:    1000000\nTotal transferred:      302000000 bytes\nHTML transferred:       151000000 bytes\nRequests per second:    142340.22 [#/sec] (mean)\nTime per request:       0.703 [ms] (mean)\nTime per request:       0.007 [ms] (mean, across all concurrent requests)\nTransfer rate:          41979.25 [Kbytes/sec] received\n...\n```\n\nThis result is tested with an i5 4210H CPU.\n\n## Available Modules\n\n| Name          | Description                             |\n| ------------- | --------------------------------------- |\n| `404`         | Return `404 Not Found` page             |\n| `info`        | Show information about the host machine |\n| `file_server` | A static file server                    |\n\n## License\n\n`Webe` is licensed under the [WTFPL](http://www.wtfpl.net/). Note that you shall not hand it in as your homework...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFugoes%2FWebe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFugoes%2FWebe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFugoes%2FWebe/lists"}