{"id":15566938,"url":"https://github.com/tdryer/darkhttpd-rs","last_synced_at":"2025-03-26T10:10:04.993Z","repository":{"id":141235675,"uuid":"380832631","full_name":"tdryer/darkhttpd-rs","owner":"tdryer","description":"Rust port of darkhttpd, a simple and fast web server for static content","archived":false,"fork":false,"pushed_at":"2021-06-27T20:42:04.000Z","size":1025,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T11:22:23.416Z","etag":null,"topics":["http","rust","server","web"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tdryer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2021-06-27T20:30:40.000Z","updated_at":"2022-09-14T05:08:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"3ebfd115-51a1-40db-ad5a-642b9be3f941","html_url":"https://github.com/tdryer/darkhttpd-rs","commit_stats":{"total_commits":666,"total_committers":19,"mean_commits":35.05263157894737,"dds":0.4564564564564565,"last_synced_commit":"83e20e5440749a5067a75a37fee3d29f70567586"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdryer%2Fdarkhttpd-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdryer%2Fdarkhttpd-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdryer%2Fdarkhttpd-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdryer%2Fdarkhttpd-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tdryer","download_url":"https://codeload.github.com/tdryer/darkhttpd-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245632423,"owners_count":20647193,"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":["http","rust","server","web"],"created_at":"2024-10-02T17:08:56.589Z","updated_at":"2025-03-26T10:10:04.969Z","avatar_url":"https://github.com/tdryer.png","language":"Rust","readme":"# darkhttpd-rs\n\nRust port of [darkhttpd], a simple and fast web server for static content.\n\nLike the original, darkhttpd-rs constrains itself to a single source file and\nminimal dependencies. Porting was done incrementally, by replacing individual C\nfunctions, until the entire program was translated.\n\ndarkhttpd-rs is experimental. You probably want to use [darkhttpd] instead.\n\n[darkhttpd]: https://unix4lyfe.org/darkhttpd/\n\n## Changes from darkhttpd\n\n* `sendfile` support required.\n* FreeBSD `acceptfilter` support (`--accf`) removed.\n* Only tested on Linux.\n\n## Features\n\n* Simple to set up:\n  * Single binary, no other files, no installation needed.\n  * Standalone, doesn't need `inetd` or `ucspi-tcp`.\n  * No messing around with config files - all you have to specify is the `www`\n    root.\n* Small memory footprint.\n* Event loop, single threaded - no `fork()` or `pthreads`.\n* Generates directory listings.\n* Supports HTTP GET and HEAD requests.\n* Supports `Range` / partial content. (try streaming music files or resuming a\n  download)\n* Supports `If-Modified-Since`.\n* Supports Keep-Alive connections.\n* Supports IPv6.\n* Can serve 301 redirects based on `Host` header.\n* Uses `sendfile()`.\n* ISC license.\n\n## Security\n\n* Can log accesses, including `Referer` and `User-Agent`.\n* Can chroot.\n* Can drop privileges.\n* Impervious to `/../` sniffing.\n* Times out idle connections.\n* Drops overly long requests.\n\n## Limitations\n\n* Only serves static content - no CGI.\n\n## How to build\n\nInstall [the Rust toolchain](https://rustup.rs/).\n\nBuild `./target/release/darkhttpd-rs` with cargo:\n\n```\ncargo build --release\n```\n\n## How to run\n\nServe `/var/www/htdocs` on the default port (80 if running as root, else 8080):\n\n```\ndarkhttpd-rs /var/www/htdocs\n```\n\nServe `~/public_html` on port 8081:\n\n```\ndarkhttpd-rs ~/public_html --port 8081\n```\n\nOnly bind to one IP address (useful on multi-homed systems):\n\n```\ndarkhttpd-rs ~/public_html --addr 192.168.0.1\n```\n\nServe at most 4 simultaneous connections:\n\n```\ndarkhttpd-rs ~/public_html --maxconn 4\n```\n\nLog accesses to a file:\n\n```\ndarkhttpd-rs ~/public_html --log access.log\n```\n\nChroot for extra security (you need root privs for chroot):\n\n```\ndarkhttpd-rs /var/www/htdocs --chroot\n```\n\nUse `default.htm` instead of `index.html`:\n\n```\ndarkhttpd-rs /var/www/htdocs --index default.htm\n```\n\nAdd mimetypes - in this case, serve `.dat` files as `text/plain`:\n\n```\n$ cat extramime\ntext/plain  dat\n$ darkhttpd-rs /var/www/htdocs --mimetypes extramime\n```\n\nDrop privileges:\n\n```\ndarkhttpd-rs /var/www/htdocs --uid www --gid www\n```\n\nRun in the background and create a pidfile:\n\n```\ndarkhttpd-rs /var/www/htdocs --pidfile /var/run/httpd.pid --daemon\n```\n\nWeb forward (301) requests for some hosts:\n\n```\ndarkhttpd-rs /var/www/htdocs \\\n  --forward example.com http://www.example.com \\\n  --forward secure.example.com https://www.example.com/secure\n```\n\nWeb forward (301) requests for all hosts:\n\n```\ndarkhttpd-rs /var/www/htdocs \\\n  --forward example.com http://www.example.com \\\n  --forward-all http://catchall.example.com\n```\n\nCommand line options can be combined:\n\n```\ndarkhttpd-rs ~/public_html --port 8080 --addr 127.0.0.1\n```\n\nTo see a full list of command line options, run darkhttpd-rs without any\narguments:\n\n```\ndarkhttpd-rs\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdryer%2Fdarkhttpd-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftdryer%2Fdarkhttpd-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdryer%2Fdarkhttpd-rs/lists"}