Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # /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
Add Comment
Please, Sign In to add comment