{"id":25483184,"url":"https://github.com/trinnguyen/sendfile-cli","last_synced_at":"2025-07-23T02:04:25.541Z","repository":{"id":72996529,"uuid":"367966149","full_name":"trinnguyen/sendfile-cli","owner":"trinnguyen","description":"Send files securely via TCP/TLS 1.3 in the local network (written in Rust)","archived":false,"fork":false,"pushed_at":"2021-05-22T23:18:27.000Z","size":42,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-28T22:08:17.467Z","etag":null,"topics":["file-sharing","rust","rustls","tcp-protocol","tls13"],"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/trinnguyen.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-05-16T19:17:04.000Z","updated_at":"2022-11-05T07:55:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"88c58589-9596-49f5-924f-7b8c5aa353b3","html_url":"https://github.com/trinnguyen/sendfile-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/trinnguyen/sendfile-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinnguyen%2Fsendfile-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinnguyen%2Fsendfile-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinnguyen%2Fsendfile-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinnguyen%2Fsendfile-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trinnguyen","download_url":"https://codeload.github.com/trinnguyen/sendfile-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinnguyen%2Fsendfile-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266604009,"owners_count":23954725,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["file-sharing","rust","rustls","tcp-protocol","tls13"],"created_at":"2025-02-18T17:02:25.182Z","updated_at":"2025-07-23T02:04:25.530Z","avatar_url":"https://github.com/trinnguyen.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sendfile-cli\n\n## Overview\n- Send files securely via TCP/TLS 1.3 in local network (no Internet needed)\n- Automatically generate TLS private/public keys pair for each connection\n\n## Process\n- Each receiver runs a TCP server to listen for connections from sender\n- Initiate state machines for server and client, communicate using a custom protocol\n- Custom protocol for TCP packets:\n\n```\n    \u003cpackage\u003e := \u003cpackage_type\u003e \u003cdata-length\u003e \u003cdata\u003e?\n    \u003cpackage_type\u003e := Send | Accept | Reject | StartFile | EndFile | FileData | Finish\n    \u003cdata-length\u003e := NUMBER\n    \u003cdata\u003e := FileInfo[] | Byte[]\n```\n\n- Length\n    - \u003cpackage_type\u003e: 1 byte (number range from 0..2^8)\n    - \u003cdata-length\u003e: 2 bytes (number range from 0..2^16)\n    - \u003cdata\u003e: byte array (maximum 61 bytes)\n\n\n## State machines (mermaid)\n\n### Receiver (or server)\n\n```mermaid\nstateDiagram-v2\n    [*] --\u003e Init\n    Init --\u003e InternalAnswer: Send?\n    InternalAnswer --\u003e Finish: Reject!\n    InternalAnswer --\u003e WaitForFile: Accept!\n    WaitForFile --\u003e StartReceivingFile: StartFile?\n    StartReceivingFile --\u003e ReceiveFileData: FileData?\n    ReceiveFileData --\u003e ReceiveFileData: FileData?\n    ReceiveFileData --\u003e EndReceivingFile: EndFile?\n    EndReceivingFile --\u003e StartReceivingFile: StartFile?\n    EndReceivingFile --\u003e Finish: Finish?\n```\n\n### Sender (or client)\n```mermaid\nstateDiagram-v2\n    [*] --\u003e Init\n    Init --\u003e WaitForResponse: Send!\n    WaitForResponse --\u003e Finish: Reject?\n    WaitForResponse --\u003e Accepted: Accept?\n    Accepted --\u003e StartSendingFile: StartFile!\n    StartSendingFile --\u003e SendFileData: FileData!\n    SendFileData --\u003e SendFileData: FileData!\n    SendFileData --\u003e EndSendingFile: EndFile!\n    EndSendingFile --\u003e StartSendingFile: StartFile!\n    EndSendingFile --\u003e Finish: Finish!\n```\n\n## Run examples\n- Run server\n    ```\n    RUST_LOG=debug cargo run -- -s 7878\n    ```\n\n- Run client\n    ```\n    RUST_LOG=debug cargo run -- -c 127.0.0.1:7878 -f test-data/file1.txt -f test-data/file2.txt\n    ```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinnguyen%2Fsendfile-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrinnguyen%2Fsendfile-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinnguyen%2Fsendfile-cli/lists"}