{"id":18278932,"url":"https://github.com/fabiokleis/fserver-udp","last_synced_at":"2025-04-12T05:10:56.445Z","repository":{"id":230469526,"uuid":"778549407","full_name":"Fabiokleis/fserver-udp","owner":"Fabiokleis","description":"golang udp file server and client","archived":false,"fork":false,"pushed_at":"2024-10-12T17:02:40.000Z","size":58,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T11:46:48.274Z","etag":null,"topics":["file-server","file-transfer-protocol","hacktoberfest","network-programming","protobuf","udp"],"latest_commit_sha":null,"homepage":"","language":"Go","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/Fabiokleis.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":"2024-03-27T23:34:39.000Z","updated_at":"2024-10-13T00:35:48.000Z","dependencies_parsed_at":"2024-04-16T23:32:56.832Z","dependency_job_id":null,"html_url":"https://github.com/Fabiokleis/fserver-udp","commit_stats":null,"previous_names":["fabiokleis/fserver-udp"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fabiokleis%2Ffserver-udp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fabiokleis%2Ffserver-udp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fabiokleis%2Ffserver-udp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fabiokleis%2Ffserver-udp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fabiokleis","download_url":"https://codeload.github.com/Fabiokleis/fserver-udp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248519545,"owners_count":21117761,"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":["file-server","file-transfer-protocol","hacktoberfest","network-programming","protobuf","udp"],"created_at":"2024-11-05T12:26:44.976Z","updated_at":"2025-04-12T05:10:56.395Z","avatar_url":"https://github.com/Fabiokleis.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fserver-udp\nudp file server, transfer files over udp socket.\n\nthis project uses protobuf to encode and decode messages: https://protobuf.dev/\nsee golang implementation in https://pkg.go.dev/google.golang.org/protobuf\n\n*obs: acho q protobuf para encodar e decodar cada pacote nao foi uma boa ideia*\n\napresentação yt: https://www.youtube.com/watch?v=9T7bCWwy4N0\n\n## Protocol\n\nThe protocol are divided in two sections, first byte is reserved to the packet identification byte, next bytes are reserved for data.\nCheck [protobuf file](./messages.proto) to known which type data are encoded.\n```protobuf\n  Server packet: [Header|Protobuf...] 1024 bytes\n  header byte types:\n  1 -\u003e RESPONSE     // file chunk\n  2 -\u003e CONFIRMATION // result\n  ...1024 bytes -\u003e Protobuf encoded data\n\n  Client packet: [Header|Protobuf...] 256 bytes\n  header byte types:\n  0 -\u003e REQUEST      // file\n  2 -\u003e CONFIRMATION // result\n  ...256 bytes -\u003e Protobuf encoded data\n\n  file name length should be less or equal 200 bytes\n```\n\n## Client\nin order to create a client implementation you must send a request message to server containing the file name, then \nstart receiving file chunks from server and send confirmation for each packet, server will wait to send next packets\nuntil a confirmation packet, if a packet was losted, client must send a missing packet confirmation and then server \nwill return sending next packets. After all packets was received, now you can reconstruct file and generate sha256 \nchecksum to validate it, if validation succeed you must send a confirmation of the checksum to the server. All needed\nmessages types are described in [protobuf file](./messages.proto), so every programming languague that has protocol \nbuffers compiler could be a client.\n\n## Communication flow\n![flux](https://github.com/Fabiokleis/fserver-udp/assets/66813406/28ad3b7d-0b9d-48da-bc71-36b4890249b4)\n\n## Docker\nto build and test easilly just run:\n```shell\ndocker build -t fserver-udp .\n```\n```shell\ndocker container run -d -p 2224:2224 --name fserver fserver-udp\n```\n\n\n## Build\nsetup golang protobuf compiler by running:\n```shell\ngo install google.golang.org/protobuf/cmd/protoc-gen-go@latest\n```\n\ngenerate golang protobuf bindings by running:\n```shell\n./proto.sh # chmod +x proto.sh\n```\n\n## Run\nstart udp server by running:\n```shell\ngo run ./cmd/fserver-udp/main.go\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiokleis%2Ffserver-udp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabiokleis%2Ffserver-udp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiokleis%2Ffserver-udp/lists"}