From: Sudhi Kulkarni Date: 2009-03-30T23:44:09+09:00 Subject: Re: Help with GServer Brian Candler wrote: > I単aki Baz Castillo wrote: >> But you should use something as Mongrel which allows this kind of stuf >> very easy and ellegant. > > For a low-level HTTP app, I'd say use Rack. You just write a single > handler function; each incoming request calls that function, and the > response is what your function returns. > > http://rack.rubyforge.org/ > http://rack.rubyforge.org/doc/files/SPEC.html > > It includes a bunch of modules you can plug in, like Rack::File which > does exactly the sort of static file serving you're talking about. And > the nice thing is you can run your application under any webserver you > like without any modification. > > For a higher-level HTTP app, I'd say use Sinatra. Your app becomes as > simple as this (minus security checks): > > require 'sinatra' > get '/:id.xml' > send_file "/path/to/#{id}.xml" > end > > Sinatra runs on Rack, and you can plugin Rack modules easily. Hi, Thanks for the solutions Sinatra and Rack look good but need a bit of extra installations which I want to avoid for this basic operation... I like the idea to parse TCP Stram... should I do it in serve()? All I get as input in serve is a io object of type TCPSocket how do I parse lines from it? Snippet would be of big help... Thanks, Sudhi -- Posted via http://www.ruby-forum.com/.