{"id":36853701,"url":"https://github.com/random-access-storage/random-access-http","last_synced_at":"2026-01-12T14:41:32.533Z","repository":{"id":65994895,"uuid":"60934786","full_name":"random-access-storage/random-access-http","owner":"random-access-storage","description":"Continuous reading from a http(s) url using random offsets and lengths for peers in a distributed system","archived":false,"fork":false,"pushed_at":"2019-12-18T21:56:23.000Z","size":69,"stargazers_count":42,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-08T08:54:05.431Z","etag":null,"topics":["dat","hypercore","hyperdrive","p2p","random-access"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/random-access-http","language":"JavaScript","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/random-access-storage.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":"2016-06-12T01:09:45.000Z","updated_at":"2023-09-08T17:11:27.000Z","dependencies_parsed_at":"2023-05-29T03:30:31.025Z","dependency_job_id":null,"html_url":"https://github.com/random-access-storage/random-access-http","commit_stats":{"total_commits":39,"total_committers":5,"mean_commits":7.8,"dds":"0.28205128205128205","last_synced_commit":"f9e8adbb0803908005a9801ecc5c3ddd67f3e8f1"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/random-access-storage/random-access-http","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/random-access-storage%2Frandom-access-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/random-access-storage%2Frandom-access-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/random-access-storage%2Frandom-access-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/random-access-storage%2Frandom-access-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/random-access-storage","download_url":"https://codeload.github.com/random-access-storage/random-access-http/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/random-access-storage%2Frandom-access-http/sbom","scorecard":{"id":761351,"data":{"date":"2025-08-11","repo":{"name":"github.com/random-access-storage/random-access-http","commit":"f9e8adbb0803908005a9801ecc5c3ddd67f3e8f1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":2,"reason":"Found 4/19 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: ISC License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 18 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T23:34:49.583Z","repository_id":65994895,"created_at":"2025-08-22T23:34:49.583Z","updated_at":"2025-08-22T23:34:49.583Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28340403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dat","hypercore","hyperdrive","p2p","random-access"],"created_at":"2026-01-12T14:41:31.715Z","updated_at":"2026-01-12T14:41:32.515Z","avatar_url":"https://github.com/random-access-storage.png","language":"JavaScript","readme":"# random-access-http\n\nContinuous reading from a http(s) url using random offsets and lengths\n\n```\nnpm install random-access-http\n```\n\n[![Build Status](https://travis-ci.org/random-access-storage/random-access-http.svg?branch=master)](https://travis-ci.org/random-access-storage/random-access-http) [![Coverage Status](https://coveralls.io/repos/github/random-access-storage/random-access-http/badge.svg?branch=master)](https://coveralls.io/github/random-access-storage/random-access-http?branch=master)\n\n## Why?\n\nPeers in a distributed system tend to come and go over a short period of time in many common p2p scenarios, especially when you are giving away a file without incentivizing the swarm to seed the file for a long time. There are also an abundance of free cloud hosts that let you host large files over http.\n\nThis module provides you random access to a file hosted over http so that it can be used by a client in a distributed system (such as hypercore or hyperdrive) to acquire parts of the file for itself and the other peers in the swarm.\n\n## Usage\n\n```js\nvar randomAccessHTTP = require('random-access-http')\n\nvar file = randomAccessHTTP('http://example.com/somefile.mp4')\n\n// Read 10 bytes at an offset of 5\nfile.read(5, 10, function(err, buffer) {\n  console.log(buffer)\n  file.close(function() {\n    console.log('http keepalive agents and sockets destroyed')\n  })\n})\n```\n\nfile will use a keepalive agent to reduce the number http requests needed for the session. When you are done you should call `file.close()` to destroy the agent.\n\n## API\n\n#### `var file = randomAccessHTTP(url, [options])`\n\nCreate a new 'file' that reads from the provided `url`. The `url` can be either `http`, `https` or a relative path if url is set in options.\n\nOptions include:\n```js\n{\n  url: string // Optionsal. The base url if first argument is relative\n  verbose: boolean, // Optional. Default: false.\n  timeout: number, // Optional. Default: 60000\n  maxRedirects: number, // Optional. Default: 10\n  maxContentLength: number, // Optional. Default: 50MB\n  strict: true, // When false, will accept non-ranged response (it will slice the response to the requested offset/length)\n}\n```\n\n#### `file.write(offset, buffer, [callback])`\n\n**Not implemented!** Please let us know if you have opinions on how to implement this.\nThis will silently fail with no data being writen.\n\n#### `file.read(offset, length, callback)`\n\nRead a buffer at a specific offset. Callback is called with the buffer read.\nBy default, this will fail if the server returns byte ranges different than what is requested.\nIf you want to support uncooperative static file servers (that doesn't use ranges), pass the `strict` with a falsy value.\n\n#### `file.close([callback])`\n\nClose outstanding http keepalive agent sockets.\n\n#### `file.on('open')`\n\nEmitted when the url has been checked to support range requests and the keep-alive agent has been created.\n\n#### `file.on('close')`\n\nEmitted after the keepalive agent and its associated sockets have been destroyed.\n\n## See Also\n\n- [bittorrent.org/beps/bep_0019 WebSeed - HTTP/FTP Seeding (GetRight style)](http://www.bittorrent.org/beps/bep_0019.html)\n- [bittorrent.org/beps/bep_0017 HTTP Seeding (Hoffman-style)](http://www.bittorrent.org/beps/bep_0017.html)\n- [RFC2616 14.35.1 Byte Ranges](http://tools.ietf.org/html/rfc2616#section-14.35)\n- [random-access-file](https://github.com/mafintosh/random-access-file)\n- [random-access-memory](https://github.com/mafintosh/random-access-memory)\n- [hypercore](https://github.com/mafintosh/hypercore)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandom-access-storage%2Frandom-access-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frandom-access-storage%2Frandom-access-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandom-access-storage%2Frandom-access-http/lists"}