{"id":17008716,"url":"https://github.com/i-e-b/shift-it","last_synced_at":"2025-07-11T21:34:36.558Z","repository":{"id":6498786,"uuid":"7739277","full_name":"i-e-b/Shift-it","owner":"i-e-b","description":"Collection of low-level HTTP and FTP file transfer tools","archived":false,"fork":false,"pushed_at":"2022-05-25T10:58:19.000Z","size":4216,"stargazers_count":4,"open_issues_count":2,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-13T09:01:03.171Z","etag":null,"topics":["c-sharp","ftp-client","http-client","production-ready","rust"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/i-e-b.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}},"created_at":"2013-01-21T19:57:37.000Z","updated_at":"2024-12-06T17:01:45.000Z","dependencies_parsed_at":"2022-09-05T03:50:30.699Z","dependency_job_id":null,"html_url":"https://github.com/i-e-b/Shift-it","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/i-e-b/Shift-it","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FShift-it","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FShift-it/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FShift-it/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FShift-it/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i-e-b","download_url":"https://codeload.github.com/i-e-b/Shift-it/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FShift-it/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264903140,"owners_count":23681127,"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":["c-sharp","ftp-client","http-client","production-ready","rust"],"created_at":"2024-10-14T05:29:05.259Z","updated_at":"2025-07-11T21:34:36.526Z","avatar_url":"https://github.com/i-e-b.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"Shift-it\n========\n\nCollection of low-level HTTP and FTP file transfer tools\n\nhttps://www.nuget.org/packages/Shift-it/\n\nWhy?\n-----\n.Net has some pretty good FTP and HTTP libraries built in. However, they aren't amazingly unit-test friendly. They also wrap a lot of status results in exceptions.\nThe protocol strictness of the libraries is also problematic when dealing with the general internet.\n\nFTP\n-----\nAn old and battle hardened FTP client library, works with many\nold and cranky FTP servers that the standard .Net libraries can't handle.\n\nHTTP\n----\nA HTTP client that can accept a reasonable level of invalid protocol from servers.\nThis is a blocking, synchronous library that uses only .Net sockets, not WebClient or HttpWebRequest, and has a lot of replaceable components.\n\nExample GET:\n```csharp\nvar rq = new HttpRequestBuilder().Get(new Uri(\"https://www.nuget.org/\")).Build();\nusing (var result = new HttpClient().Request(rq)) {\n    var body = result.BodyReader.ReadStringToLength();\n    // . . .\n}\n```\n\nExample POST string data, without reading result:\n```csharp\nvar client = new HttpClient();\nvar postRq = new HttpRequestBuilder().Put(new Uri(\"https://target.example.com/resource\")).Build(\"Hello, world\");\nclient.Request(postRq).Dispose();\n```\n\nExample with upload and download with files and progress:\n```csharp\nlong uploadBytes = 0;\nlong downloadBytes = 0;\n\nusing (var fs = File.OpenRead(@\"C:\\my\\file.dat\"))\n{\n    var rq = new HttpRequestBuilder()\n    .Post(new Uri(\"http://myserver.com/whatever\"))\n    .Build(fs, fs.Length);\n\n    using (var result = new HttpClient().Request(rq, b =\u003e uploadBytes = b))\n    {\n        var responseString = result.BodyReader.ReadStringToLength(b =\u003e downloadBytes = b);\n    }\n}\n```\n\nPerformance\n===========\nThanks to [skolima](https://github.com/skolima) for these:\n\n```\n=== 14MB file\n\nMeasured on Windows\nTime taken        Mem         Method\n-\u003e2849ms          29MB        Web client\n-\u003e2657ms          20MB        Web Client - stream copy, no hash\n-\u003e2647ms          16MB        Web Client - stream copy, Shift-It hash\n-\u003e1575ms          0MB         ShiftIt [current]\n-\u003e1592ms          0MB         ShiftIt - no hashing [current]\n-\u003e1616ms          0MB         ShiftIt - no compression [current]\n-\u003e1574ms          0MB         ShiftIt - no hashing, no compression [current]\n\n\nMeasured on Mono + Linux + fast connection\nTime taken        Mem     Method\n-\u003e1763ms          30MB    Web client\n-\u003e403ms           1MB     Web Client - stream copy, no hash\n-\u003e651ms           16MB    Web Client - stream copy, Shift-It hash\n-\u003e755ms           0MB     ShiftIt [current]\n-\u003e603ms           0MB     ShiftIt - no hashing [current]\n-\u003e762ms           0MB     ShiftIt - no compression [current]\n-\u003e669ms           0MB     ShiftIt - no hashing, no compression [current]\n-\u003e833ms           0MB     ShiftIt [previous]\n-\u003e602ms           0MB     ShiftIt - no hashing [previous]\n-\u003e903ms           0MB     ShiftIt - no compression [previous]\n-\u003e601ms           0MB     ShiftIt - no hashing, no compression [previous]\n\n=== 191MB file\n\nMeasured on Windows\nTime taken        Mem        Method\n-\u003e35378ms       638MB   Web client\n-\u003e34211ms       334MB   Web Client - stream copy, no hash\n-\u003e35382ms       320MB   Web Client - stream copy, Shift-It hash\n-\u003e20292ms       0MB     ShiftIt [current]\n-\u003e20157ms       0MB     ShiftIt - no hashing [current]\n-\u003e20446ms       0MB     ShiftIt - no compression [current]\n-\u003e19689ms       0MB     ShiftIt - no hashing, no compression [current]\n\nMeasured on Mono + Linux + fast connection\nTime taken        Mem        Method\n-\u003e17435ms       383MB   Web client\n-\u003e5843ms        69MB    Web Client - stream copy, no hash\n-\u003e9327ms        260MB   Web Client - stream copy, Shift-It hash\n-\u003e12948ms       0MB     ShiftIt [current]\n-\u003e8529ms        0MB     ShiftIt - no hashing [current]\n-\u003e13472ms       0MB     ShiftIt - no compression [current]\n-\u003e8108ms        0MB     ShiftIt - no hashing, no compression [current]\n-\u003e13584ms       0MB     ShiftIt [previous]\n-\u003e8237ms        0MB     ShiftIt - no hashing [previous]\n-\u003e10648ms       0MB     ShiftIt - no compression [previous]\n-\u003e7308ms        0MB     ShiftIt - no hashing, no compression [previous]\n```\n\nTodo\n-----\n* Digest authentication\n* chunked upload\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-e-b%2Fshift-it","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi-e-b%2Fshift-it","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-e-b%2Fshift-it/lists"}