WEBrick is a Ruby library that makes it easy to build an HTTP server with Ruby : Webrick Web Server « Network « Ruby






WEBrick is a Ruby library that makes it easy to build an HTTP server with Ruby


require 'webrick'

server = WEBrick::GenericServer.new(:Port => 1234)

trap("INT"){ server.shutdown }

server.start do |socket|
  socket.puts Time.now
end

 








Related examples in the same category

1.access to request and response objects
2.find out what URL the user tried to access in his or her browser