Created
June 8, 2012 18:26
-
-
Save ehlertij/2897415 to your computer and use it in GitHub Desktop.
em-proxy proxy.rb
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
# /data/ngin/shared/proxy/proxy.rb | |
require 'em-proxy' | |
Proxy.start(:host => "0.0.0.0", :port => EMPROXY_PORT) do |conn| | |
conn.server :self, :host => '127.0.0.1', :port => NGINX_PORT | |
conn.server :proxy, :host => PROXY_IP, :port => PROXY_PORT | |
conn.on_data do |data| | |
data | |
end | |
conn.on_response do |server, resp| | |
resp if server == :self | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment