{"id":20904169,"url":"https://github.com/visheshc14/neo-rust","last_synced_at":"2025-08-02T00:06:45.538Z","repository":{"id":105857508,"uuid":"409847386","full_name":"visheshc14/Neo-Rust","owner":"visheshc14","description":"Neo is a Single File Server. It Responds to Every GET Request it Receives with the Content of a Given File (Specified by ENV or CLI Argument), and for Every Other Request (with any other HTTP Method or Path) it returns a 404. Written in GoLang \u0026 Rust Separately.","archived":false,"fork":false,"pushed_at":"2021-10-13T12:35:11.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-19T13:54:24.470Z","etag":null,"topics":["env-analyzer","http-server","miniserve","pathbuf","rust-lang","tcp-socket","tls-certificate"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/visheshc14.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-24T05:50:33.000Z","updated_at":"2023-03-07T09:17:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"9364b9d9-3552-49ac-af51-68f6de6c1d4d","html_url":"https://github.com/visheshc14/Neo-Rust","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/visheshc14%2FNeo-Rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visheshc14%2FNeo-Rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visheshc14%2FNeo-Rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visheshc14%2FNeo-Rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/visheshc14","download_url":"https://codeload.github.com/visheshc14/Neo-Rust/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243294451,"owners_count":20268241,"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":["env-analyzer","http-server","miniserve","pathbuf","rust-lang","tcp-socket","tls-certificate"],"created_at":"2024-11-18T13:16:14.685Z","updated_at":"2025-03-12T21:20:08.823Z","avatar_url":"https://github.com/visheshc14.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `Neo`\n\n`Neo` is a single file server. It responds to every `GET` request it receives with the content of a given file (specified by ENV, CLI argument or STDIN), and for every other request (with any other HTTP method or path) it returns a 404.\n\n`Neo` was invented to help with cases where a generally small file needs to be delivered at a certain path, for example [MTA STS's `/.well-known/mta-sts.txt`](https://en.wikipedia.org/wiki/MTA-STS). \n\n\nSee also [`-go`](https://github.com/visheshc14/Neo-Go)\n\n# Quickstart\n\n`Neo` only needs the path to a single file to run:\n\n```console\n$ Neo -f \u003cfile path\u003e\n```\n\nBy default, `Neo` will serve the file at host `127.0.0.1` on port `5000`. `Neo` can also take file content from STDIN like so:\n\n```console\n$ Neo \u003c\u003cEOF\n\u003e your file content\n\u003e goes here\n\u003e EOF\n```\n\n# Usage\n\n```console\nNeo 0.1.0\n\nUSAGE:\n    Neo [OPTIONS]\n\nFLAGS:\n        --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n    -f, --file \u003cFILE\u003e                                                File to read [env: FILE=]\n    -h, --host \u003chost\u003e                                                Host [env: HOST=]  [default: 127.0.0.1]\n    -p, --port \u003cport\u003e                                                Port [env: PORT=]  [default: 5000]\n        --stdin-read-timeout-seconds \u003cstdin-read-timeout-seconds\u003e\n            Amount of seconds to wait for input on STDIN to serve [env: STDIN_READ_TIMEOUT_SECONDS=]  [default: 60]\n```\n\n# Environment Variables\n\n| ENV variable                 | Default     | Example                 | Description                                      |\n|------------------------------|-------------|-------------------------|--------------------------------------------------|\n| `HOST`                       | `127.0.0.1` | `0.0.0.0`               | The host on which `Neo` will listen             |\n| `PORT`                       | `5000`      | `3000`                  | The port on which `Neo` will listen             |\n| `STDIN_READ_TIMEOUT_SECONDS` | `60`        | `10`                    | The amount of seconds to try and read from STDIN |\n| `FILE`                       | N/A         | `/path/to/your/file`    | The path to the file that will be served         |\n| `TLS_KEY`                    | N/A         | `/path/to/your/tls.key` | Path to a file contains a PEM-encoded TLS key    |\n| `TLS_CERT`                   | N/A         | `/path/to/your/tls.crt` | Path to a file contains CA cert(s)               |\n\n# Useful Makefile targets\n\nThe following targets are mostly useful for development, testing the current build, as most depend on `cargo run`.\n\n## Running the current build of `Neo` with HEREDOCs\n\n```console\n$ make run \u003c\u003cEOF\n\u003e\n\u003e You enter some text\n\u003e EOF\ncargo run\n    Finished dev [unoptimized + debuginfo] target(s) in 0.04s\n     Running `target/debug/Neo`\n[2021-05-09T02:51:58Z INFO  Neo] Server configured to run @ [127.0.0.1:5000]\n[2021-05-09T02:51:58Z INFO  Neo] No file path provided, waiting for input on STDIN (max 60 seconds)...\n[2021-05-09T02:51:58Z INFO  Neo] Successfully read input from STDIN\n[2021-05-09T02:51:58Z INFO  Neo] Read [16] characters\n[2021-05-09T02:51:58Z INFO  Neo] Starting HTTP server...\n```\n\n## Serve the example file in the repository\n\n```console\n$ make example\n```\n\nYou can serve the example file in the repository with TLS as well\n\n```console\n$ make example-tls\n```\n\nNote that the example page is *NOT* included in the `Neo` binary, you have to bring your own file to serve at production time.\n\n## Cutting a release\n\nTo cut a release, in a branch or off of `main` do the following:\n\n1. Make necessary code changes (if any) \u0026 test\n2. Update `Cargo.toml`\n3. Update `CHANGELOG.md`\n4. Run `make image image-publish image-release`\n5. If satisfied, run `make release-prep` (this will create an all-in-one commit that is tagged properly with the new version)\n6. `git push` the commit\n7. Run `cargo publish` to publish to cargo\n\n# FAQ\n\n# Alternatives\n\n## `miniserve`\n\n**tl;dr `Neo` is about 2x faster than `miniserve`, which is expected as it does much less.**\n\n[`miniserve`](https://crates.io/crates/miniserve) is a project that aims to serve files and directories over HTTP that was suggested. Since `miniserve` is also capable of serving a single file I've tested it gainst `Neo` with the usual `wrk` command and here are the results tabulated. Roughly by running the following:\n\n```console\n$ Neo -f /tmp/testfiles/file-1M \u0026\n$ miniserve /tmp/testfiles/file-1M -p 5001 \u0026\n$ wrk -t12 -c400 -d30s --latency http://127.0.0.1:5000/any/path/will/work # a few times\n$ wrk -t12 -c400 -d30s --latency http://127.0.0.1:5001 # a few times\n```\n\n|                                    | `Neo` | `miniserve` |\n|------------------------------------|--------|-------------|\n| Latency 50% (ms)                   | 21.09  | 83.94       |\n| Latency 75% (ms)                   | 31.04  | 95.73       |\n| Latency 90% (ms)                   | 40.81  | 107.23      |\n| Latency 99% (ms)                   | 58.54  | 129.38      |\n| (Thread stats) Latency avg (ms)    | 23.29  | 84.94       |\n| (Thread stats) Latency stddev (ms) | 12.57  | 17.11       |\n| (Thread stats) Latency max (ms)    | 120.18 | 182.87      |\n| Request/sec                        | 11,900 | 4599        |\n| Trasfer/sec (MB)                   | 1162   | 450         |\n\nAs you might expect, `Neo` does so little (though there are some feature differences in the overlap) that it performs roughly 2x as well as `miniserve`.\n\nI did not limit the processes and my machine is pretty beefy: 6 physical cores (12 hyper threads) and 32GB of RAM so these processes got as much room as they cared to use.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvisheshc14%2Fneo-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvisheshc14%2Fneo-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvisheshc14%2Fneo-rust/lists"}