{"id":20649246,"url":"https://github.com/marcolucidi01/sws","last_synced_at":"2025-08-17T22:18:09.490Z","repository":{"id":193649496,"uuid":"214840224","full_name":"MarcoLucidi01/sws","owner":"MarcoLucidi01","description":"Simple Small Static Stupid Whatever Web Server","archived":false,"fork":false,"pushed_at":"2019-12-29T19:01:53.000Z","size":145,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-17T12:16:19.901Z","etag":null,"topics":["c","http","server","simple","small","socket","static","stupid","web"],"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/MarcoLucidi01.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}},"created_at":"2019-10-13T15:02:32.000Z","updated_at":"2023-11-19T05:02:03.000Z","dependencies_parsed_at":"2023-09-09T08:29:23.341Z","dependency_job_id":"413f29c6-f682-467f-9c50-26b494492ebc","html_url":"https://github.com/MarcoLucidi01/sws","commit_stats":null,"previous_names":["marcolucidi01/sws"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MarcoLucidi01/sws","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcoLucidi01%2Fsws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcoLucidi01%2Fsws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcoLucidi01%2Fsws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcoLucidi01%2Fsws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarcoLucidi01","download_url":"https://codeload.github.com/MarcoLucidi01/sws/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcoLucidi01%2Fsws/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270914922,"owners_count":24667231,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["c","http","server","simple","small","socket","static","stupid","web"],"created_at":"2024-11-16T17:13:19.360Z","updated_at":"2025-08-17T22:18:09.468Z","avatar_url":"https://github.com/MarcoLucidi01.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"sws: Simple Small Static Stupid Whatever Web Server\n===================================================\n\nI was learning about sockets and network programming (yes, [Beej's guide](http://beej.us/guide/bgnet/))\nand decided to implement a tiny HEAD GET only http server as exercise.\n\nthe idea was to mimic and maybe improve what you can do with the command:\n\n    $ python3 -m http.server\n\nit speaks HTTP/1.0 (more or less) and it will accept HTTP/1.1 requests, anything\nelse will be rejected.\n\nfeatures\n========\n\n- Connection keep-alive\n- range requests (only one byte range is allowed)\n- If-Modified-Since\n- directory listing\n- custom index page file (default index.html)\n\ninstall / uninstall\n===================\n\nto install inside directory `/usr/local/bin/` run\n\n    $ make install\n\nto uninstall run\n\n    $ make uninstall\n\nusage\n=====\n\nto serve your current working directory at http://localhost:8080 run\n\n    $ sws\n\nto serve directory `/foo/bar` at http://localhost:8080 run\n\n    $ sws -r /foo/bar\n\nto serve directory `/foo/bar` at http://localhost:6666 using file `home.html`\nas index page run\n\n    $ sws -r /foo/bar -p 6666 -i home.html\n\nbenchmarks\n==========\n\nmy machine is a i5-4300U @ 1.90GHz with 4GB of RAM running Linux 4.19 (Debian 10)\n\n13 bytes ascii file\n\n    $ more hello\n    Hello World!\n    $ sws \u003e /dev/null\n\n    $ wrk -c 500 -t 10 -d 10s --latency http://localhost:8080/hello\n    Running 10s test @ http://localhost:8080/hello\n      10 threads and 500 connections\n      Thread Stats   Avg      Stdev     Max   +/- Stdev\n        Latency    18.71ms  107.40ms   1.67s    96.72%\n        Req/Sec     0.87k   697.31     4.26k    76.36%\n      Latency Distribution\n         50%    3.11ms\n         75%    3.96ms\n         90%    5.62ms\n         99%  450.05ms\n      78317 requests in 10.07s, 16.51MB read\n      Socket errors: connect 0, read 0, write 0, timeout 43\n    Requests/sec:    7774.18\n    Transfer/sec:    1.64MB\n\n1MB random file\n\n    $ head -c $(( 2 ** 20 )) /dev/urandom \u003e foo\n    $ sws \u003e /dev/null\n\n    $ wrk -c 500 -t 10 -d 10s --latency http://localhost:8080/foo\n    Running 10s test @ http://localhost:8080/foo\n      10 threads and 500 connections\n      Thread Stats   Avg      Stdev     Max   +/- Stdev\n        Latency    62.64ms  155.25ms   1.94s    94.20%\n        Req/Sec   154.08     66.77   434.00     68.91%\n      Latency Distribution\n         50%   27.90ms\n         75%   45.25ms\n         90%   86.70ms\n         99%  881.81ms\n      15150 requests in 10.09s, 14.80GB read\n      Socket errors: connect 0, read 0, write 0, timeout 20\n    Requests/sec:    1501.31\n    Transfer/sec:    1.47GB\n\n64 entries directory listing\n\n    $ ls Music/Playlist\\ Pink\\ Floyd/ | wc -l\n    64\n    $ sws \u003e /dev/null\n\n    $ wrk -c 500 -t 10 -d 10s --latency http://localhost:8080/Music/Playlist%20Pink%20Floyd/\n    Running 10s test @ http://localhost:8080/Music/Playlist%20Pink%20Floyd/\n      10 threads and 500 connections\n      Thread Stats   Avg      Stdev     Max   +/- Stdev\n        Latency    34.22ms  139.70ms   1.84s    95.76%\n        Req/Sec   391.74    263.27     1.42k    64.00%\n      Latency Distribution\n         50%   10.50ms\n         75%   11.54ms\n         90%   12.81ms\n         99%  797.23ms\n      34812 requests in 10.10s, 285.65MB read\n      Socket errors: connect 0, read 0, write 0, timeout 48\n    Requests/sec:    3447.72\n    Transfer/sec:    28.29MB\n\nplease don't use this thing in any real world environment! I use it inside my\nLAN to share files, stream videos and to play around with static websites.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcolucidi01%2Fsws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcolucidi01%2Fsws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcolucidi01%2Fsws/lists"}