1 require 'webrick' 2 s = WEBrick::HTTPServer.new(:Port => 2002) 3 s.mount_proc("/") {|req,res| 4 res.body = "http://#{req['host']}#{req.request_uri}"; 5 } 6 s.start