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

udpbucket

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

udpbucket

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

UDPBucket

A simple UDP server library using working queue.

requirements

  • ruby 1.9.3+
  • json
  • asetus 0.0.7+
  • logger 1.2.8+

install

> gem install udpbucket
>

packets

UDPBucket returns to a block each packet it receives to the listening UDP port formatted in a standard hash.

hash format

{ :client_sock => <socket_object>, 
  :client_ip => 'x.x.x.x', 
  :client_port => xxxxx, 
  :payload => '\x00\xFF\xFF' }

example:

require 'udpbucket'

begin
  cfg = { :localhost => '0.0.0.0', :localport => 1024, :debug => 0 }
  udpbucket = UDPBucket::Core.new cfg
  udpbucket.listen do |req|
    if req[:payload] == '\x00\xFF\xFF'
      req[:client_sock].send '<..some payload..>', 0, req[:client_ip], req[:client_port]
          udpbucket.debug "reply sent to client: #{req[:client_ip]}:#{req[:client_port]}" if cfg[:debug] == 1
    end
  end
end

configuration:

The configuration is loaded at the start via Asetus. If the configuration is not passed to the 'Core' class, Asetus will load the default set (localhost:'0.0.0.0',localport:'16265',debug:'0')

FAQs

Package last updated on 06 Apr 2015

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