{"id":13705691,"url":"https://github.com/HashLoad/horse-octet-stream","last_synced_at":"2025-05-05T16:33:37.127Z","repository":{"id":43377841,"uuid":"153815055","full_name":"HashLoad/horse-octet-stream","owner":"HashLoad","description":"octet-stream middleware for horse","archived":false,"fork":false,"pushed_at":"2024-05-06T13:52:44.000Z","size":713,"stargazers_count":74,"open_issues_count":1,"forks_count":18,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-21T20:25:45.313Z","etag":null,"topics":["horse","horse-octet-stream","middleware","pdf","stream"],"latest_commit_sha":null,"homepage":null,"language":"Pascal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HashLoad.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}},"created_at":"2018-10-19T16:56:52.000Z","updated_at":"2025-01-20T00:23:24.000Z","dependencies_parsed_at":"2023-12-30T06:31:31.289Z","dependency_job_id":"5418cc3d-35e3-4e7b-b2c2-e7fd96aeb1b5","html_url":"https://github.com/HashLoad/horse-octet-stream","commit_stats":{"total_commits":38,"total_committers":13,"mean_commits":2.923076923076923,"dds":0.5,"last_synced_commit":"2e83e9c7149535754ce2e18f279f199475ec29b2"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fhorse-octet-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fhorse-octet-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fhorse-octet-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fhorse-octet-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HashLoad","download_url":"https://codeload.github.com/HashLoad/horse-octet-stream/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250942621,"owners_count":21511381,"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":["horse","horse-octet-stream","middleware","pdf","stream"],"created_at":"2024-08-02T22:00:46.184Z","updated_at":"2025-05-05T16:33:37.068Z","avatar_url":"https://github.com/HashLoad.png","language":"Pascal","readme":"# horse-octet-stream\n\u003cb\u003ehorse-octet-stream\u003c/b\u003e is an official middleware for working with Stream in APIs developed with the \u003ca href=\"https://github.com/HashLoad/horse\"\u003eHorse\u003c/a\u003e framework.\n\u003cbr\u003eWe created a channel on Telegram for questions and support:\u003cbr\u003e\u003cbr\u003e\n\u003ca href=\"https://t.me/hashload\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/telegram-join%20channel-7289DA?style=flat-square\"\u003e\n\u003c/a\u003e\n\n## ⚙️ Installation\nInstallation is done using the [`boss install`](https://github.com/HashLoad/boss) command:\n``` sh\nboss install horse-octet-stream\n```\nIf you choose to install manually, simply add the following folders to your project, in *Project \u003e Options \u003e Resource Compiler \u003e Directories and Conditionals \u003e Include file search path*\n```\n../horse-octet-stream/src\n```\n\n## ✔️ Compatibility\nThis middleware is compatible with projects developed in:\n- [X] Delphi\n- [X] Lazarus\n\n## ⚡️ Quickstart Delphi\n```delphi\nuses\n  Horse,\n  Horse.OctetStream, // It's necessary to use the unit\n  System.Classes,\n  System.SysUtils;\n\nbegin\n  // It's necessary to add the middleware in the Horse:\n  THorse.Use(OctetStream);\n\n  THorse.Get('/stream',\n    procedure(Req: THorseRequest; Res: THorseResponse; Next: TProc)\n    var\n      LStream: TFileStream;\n    begin\n      // Now you can send your stream:\n      LStream := TFileStream.Create(ExtractFilePath(ParamStr(0)) + 'horse.pdf', fmOpenRead);\n      Res.Send\u003cTStream\u003e(LStream);\n    end);\n\n  THorse.Listen(9000);\nend;\n```\n\n## ⚡️ Quickstart Lazarus\n```delphi\n{$MODE DELPHI}{$H+}\n\nuses\n  {$IFDEF UNIX}{$IFDEF UseCThreads}\n  cthreads,\n  {$ENDIF}{$ENDIF}\n  Horse,\n  Horse.OctetStream, // It's necessary to use the unit\n  SysUtils, \n  Classes;\n\nprocedure GetStream(Req: THorseRequest; Res: THorseResponse; Next: TNextProc);\nvar\n  LStream: TFileStream;\nbegin\n  // Now you can send your stream:\n  LStream := TFileStream.Create(ExtractFilePath(ParamStr(0)) + 'horse.pdf', fmOpenRead);\n  Res.Send\u003cTStream\u003e(LStream).ContentType('application/pdf');\nend;\n\nbegin\n  // It's necessary to add the middleware in the Horse:\n  THorse.Use(OctetStream);\n\n  THorse.Get('/stream', GetStream);\n\n  THorse.Listen(9000);\nend.\n```\n\n## ⚠️ License\n`horse-octet-stream` is free and open-source middleware licensed under the [MIT License](https://github.com/HashLoad/horse-octet-stream/blob/master/LICENSE). \n","funding_links":[],"categories":["Network"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHashLoad%2Fhorse-octet-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHashLoad%2Fhorse-octet-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHashLoad%2Fhorse-octet-stream/lists"}