Skip to content

Instantly share code, notes, and snippets.

@ajsharp
Created October 5, 2011 21:07
Show Gist options
  • Select an option

  • Save ajsharp/1265742 to your computer and use it in GitHub Desktop.

Select an option

Save ajsharp/1265742 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'em-proxy'
Proxy.start(:host => '0.0.0.0', :port => 8082, :debug => true) do |conn|
conn.server :one, :host => '127.0.0.1', :port => 8080
conn.server :two, :host => '127.0.0.1', :port => 8081
conn.on_data do |data|
data
end
conn.on_response do |server, resp|
resp if server == :one
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment