Class: Proxy
- Inherits:
-
Object
- Object
- Proxy
- Defined in:
- lib/em-proxy/proxy.rb
Class Method Summary collapse
Class Method Details
.start(options, &blk) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/em-proxy/proxy.rb', line 3 def self.start(, &blk) EM.epoll EM.run do trap("TERM") { stop } trap("INT") { stop } EventMachine::start_server([:host], [:port], EventMachine::ProxyServer::Connection, ) do |c| c.instance_eval(&blk) end end end |
.stop ⇒ Object
17 18 19 20 |
# File 'lib/em-proxy/proxy.rb', line 17 def self.stop puts "Terminating ProxyServer" EventMachine.stop end |