{"id":28451940,"url":"https://github.com/reednj/udp_rest","last_synced_at":"2025-07-02T03:31:04.965Z","repository":{"id":59158477,"uuid":"75346609","full_name":"reednj/udp_rest","owner":"reednj","description":"Client and server modules to allow making REST HTTP requests over UDP","archived":false,"fork":false,"pushed_at":"2017-06-14T06:27:32.000Z","size":55,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-05T11:36:35.190Z","etag":null,"topics":["http","rest","ruby","udp"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/udp_rest","language":"Ruby","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/reednj.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-02T00:58:05.000Z","updated_at":"2025-01-25T19:47:33.000Z","dependencies_parsed_at":"2022-09-13T20:04:01.707Z","dependency_job_id":null,"html_url":"https://github.com/reednj/udp_rest","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/reednj/udp_rest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reednj%2Fudp_rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reednj%2Fudp_rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reednj%2Fudp_rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reednj%2Fudp_rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reednj","download_url":"https://codeload.github.com/reednj/udp_rest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reednj%2Fudp_rest/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263069053,"owners_count":23408889,"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":["http","rest","ruby","udp"],"created_at":"2025-06-06T17:09:39.959Z","updated_at":"2025-07-02T03:31:04.930Z","avatar_url":"https://github.com/reednj.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# REST over UDP\n\nREST is a useful pattern for client-server interaction, but for simple scenarios setting up an entire HTTP stack is overkill. This gem provides a classes to allow for REST over UDP using a http-like protocol, as well as a curl like app for making requests from the command line.\n\nThe request and response size is limited 512 bytes, so this model is only appropriate for certain uses. Obviously it isn't very good for returning large amounts of data, but rather for sending commands to an endpoint, or logging small amounts of data with a high frequency.\n\n## Try it out\n\nThere is a udp rest server running on uhttp.reednj.com, port 7890.\n\n\tgem install udp_rest\n\tudp-rest uhttp.reednj.com:7890\n\n![terminal](docs/term.png)\n\nSome other urls to try are:\n\n - uhttp.reednj.com:7890/time/iso\n - uhttp.reednj.com:7890/time/unix\n - uhttp.reednj.com:7890/count\n\n## Client\n\nUse the `UDPRest::Client` class to make requests programmatically\n\n\tUDPRest::Client.get('uhttp://uhttp.reednj.com:7890')\n\tUDPRest::Client.post('uhttp://uhttp.reednj.com:7890')\n\n## Server\n\nUse the `UDPRest::Server` class to create simple sinatra-style servers\n\n\tUDPRest::Server.new(:port =\u003e 7890) do |s|\n\t\ts.get '/' do\n\t\t\t'hello, world!'\n\t\tend\n\n\t\ts.get '/time' do\n\t\t\tTime.now.to_s\n\t\tend\n\n\t\ts.get '/echo' do |request|\n\t\t\tparams['data'].to_s\n\t\tend\n\tend\n\n## Performance\n\nThe performance difference can be quite signficant when making requests with poor latency - for example a request from Australia to the US takes about 900ms with http, and 300 - 400ms with udp_rest.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freednj%2Fudp_rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freednj%2Fudp_rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freednj%2Fudp_rest/lists"}