-
-
Save danvine/5119351 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'em-proxy' | |
Proxy.start(:host => "0.0.0.0", :port => 9201, :debug => false) do |conn| | |
conn.server :srv, :host => "127.0.0.1", :port => 9200 | |
conn.on_data do |data| | |
puts data | |
data | |
end | |
conn.on_response do |backend, resp| | |
puts resp | |
resp | |
end | |
conn.on_finish do |backend, name| | |
puts name | |
unbind if backend == :srv | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment