Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

udp_rest

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

udp_rest

  • 0.9.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

REST over UDP

REST 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.

The request and response size is limited 512 bytes, so this model is only appropriate for certain apis.

Try it out

There is a udp rest server running on uhttp.reednj.com, port 7890.

gem install udp_rest
udp-rest uhttp.reednj.com:7890

terminal

Some other urls to try are:

  • uhttp.reednj.com:7890/time/iso
  • uhttp.reednj.com:7890/time/unix
  • uhttp.reednj.com:7890/count

Client

Use the UDPRest::Client class to make requests programmatically

UDPRest::Client.get('uhttp://uhttp.reednj.com:7890')
UDPRest::Client.post('uhttp://uhttp.reednj.com:7890')

Server

Use the UDPRest::Server class to create simple sinatra-style servers

UDPRest::Server.new(:port => 7890) do |s|
	s.get '/'
		'hello, world!'
	end

	s.get '/time'
		Time.now.to_s
	end
end

FAQs

Package last updated on 15 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc