register.rb 246 Bytes
O'Reilly Media, Inc. committed
1 2 3 4 5 6 7 8
require 'dnssd'
registration = DNSSD.register("", "_http._tcp", nil, 8080) do |register_reply|
  puts "Registration result: #{register_reply.inspect}"
end
puts "Registration started"
sleep 30
registration.stop
puts "Registration stopped"