{"id":17300871,"url":"https://github.com/chtjonas/httkey-server","last_synced_at":"2025-03-26T21:45:10.400Z","repository":{"id":37610029,"uuid":"327748419","full_name":"CHTJonas/httkey-server","owner":"CHTJonas","description":"HTTP server that serves files based on the hash of the URL","archived":false,"fork":false,"pushed_at":"2024-11-05T19:43:54.000Z","size":354,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-01T03:42:15.062Z","etag":null,"topics":["blake","file-server","go","golang","http-server","murmurhash3","static-file-server"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CHTJonas.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":"2021-01-07T23:28:26.000Z","updated_at":"2024-11-05T19:43:58.000Z","dependencies_parsed_at":"2024-06-21T09:56:44.859Z","dependency_job_id":"cdb61f6c-3f69-496c-82e6-f92bb074a324","html_url":"https://github.com/CHTJonas/httkey-server","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CHTJonas%2Fhttkey-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CHTJonas%2Fhttkey-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CHTJonas%2Fhttkey-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CHTJonas%2Fhttkey-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CHTJonas","download_url":"https://codeload.github.com/CHTJonas/httkey-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245743341,"owners_count":20665090,"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":["blake","file-server","go","golang","http-server","murmurhash3","static-file-server"],"created_at":"2024-10-15T11:30:44.542Z","updated_at":"2025-03-26T21:45:10.384Z","avatar_url":"https://github.com/CHTJonas.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# httkey\n\nhttkey is a simple web server that serves static files but with a twist. The host and path of an incoming HTTP request are hashed and the result of this is used to determine the file to serve. httkey was in part inspired by Google's SFFE (Static File Front End) web server.\n\n## Design Specification\n\n* Binaries should be statically-linked with any assets (e.g. error pages) embedded.\n* Files should be served from a single directory. There should be no sub-hierarchy.\n* The hash should be a 128-bit MurmurHash3 of the request path, seeded with the contents of the `Host` header.\n* The binary output of the hash should be encoded in hexadecimal form.\n* If a file exists with a name that matches the hex-encoded output of the hash and the request method is `GET` then we should serve it.\n* If a file exists but the requests method is not `GET` then we should serve a `405` error page.\n* If a file does not exist then we should serve a `404` error page.\n\nIt's expected that httkey will be run behind a reverse proxy such as nginx which will take care of the TLS termination. As such, URLs are often handled internally as `http` rather than `https` however this makes no practical difference. Port numbers also have no bearing on the overall hashing.\n\n## Build\n\nTo compile httkey you can run the following in a terminal. This will produce 64-bit binaries for Windows and macOS in addition to Linux binaries for the `arm`, `arm64`, `i386` and `amd64` architectures.\n\n```bash\nmake clean \u0026\u0026 make build\n```\n\n## Quickstart\n\nThis quick example demonstrates how you can deploy a static [MTA-STS policy](https://en.wikipedia.org/wiki/MTA-STS) ([RFC 8461](https://tools.ietf.org/html/rfc8461)) using httkey:\n\n```\n$ httkey hash http://mta-sts.example.com/.well-known/mta-sts.txt\nhttp://mta-sts.example.com/.well-known/mta-sts.txt\tc18eefdae3a2b5d69501ac89b6c5a9e69087e601\n\n$ cat \u003e /tmp/c18eefdae3a2b5d69501ac89b6c5a9e69087e601 \u003c\u003cEOF\nversion: STSv1\nmode: enforce\nmx: mail.example.com\nmax_age: 86400\nEOF\n\n$ httkey serve -p /tmp\n```\n\nAnd in a different terminal tab:\n\n```\n$ curl --resolve mta-sts.example.com:8080:127.0.0.1 http://mta-sts.example.com:8080/.well-known/mta-sts.txt\nversion: STSv1\nmode: enforce\nmx: mail.example.com\nmax_age: 86400\n```\n\nA production MTA-STS deployment would need DNS \u0026 TLS provisiong and setting up correctly but this is out of scope for this simple demonstration.\n\n## Usage\n\n```\nUsage:\n  httkey [command]\n\nAvailable Commands:\n  hash        Hash a URL\n  help        Help about any command\n  license     Print copyright license\n  serve       Run web server\n  version     Print version information\n\nUse \"httkey [command] --help\" for more information about a command.\n```\n\n## Copyright\n\nCopyright (c) 2021 Charlie Jonas.\\\nThe code here is released under the [BSD 2-Clause License](https://opensource.org/licenses/BSD-2-Clause).\\\nSee the LICENSE file for full details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchtjonas%2Fhttkey-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchtjonas%2Fhttkey-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchtjonas%2Fhttkey-server/lists"}