Skip to content

Instantly share code, notes, and snippets.

@igrigorik
Forked from gleicon/vuvuzelr_proxy.rb
Created June 20, 2010 02:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save igrigorik/445500 to your computer and use it in GitHub Desktop.
Save igrigorik/445500 to your computer and use it in GitHub Desktop.
# minimal async sinatra app
# requires ruby 1.9.x
require 'sinatra'
require 'em-http'
require 'em-synchrony'
require 'em-synchrony/em-http'
require 'rack/fiber_pool'
use Rack::FiberPool
before do
content_type :html, 'charset' => 'utf-8'
end
get '/test' do
http = EM::HttpRequest.new('http://www.igvita.com/').get
http.response
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment