Guest User

Untitled

a guest
Oct 19th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. # /data/ngin/shared/proxy/proxy.rb
  2. require 'em-proxy'
  3.  
  4. Proxy.start(:host => "0.0.0.0", :port => EMPROXY_PORT) do |conn|
  5. conn.server :self, :host => '127.0.0.1', :port => NGINX_PORT
  6. conn.server :proxy, :host => PROXY_IP, :port => PROXY_PORT
  7. conn.on_data do |data|
  8. data
  9. end
  10. conn.on_response do |server, resp|
  11. resp if server == :self
  12. end
  13. end
Add Comment
Please, Sign In to add comment