Class: Proxy
- Inherits:
-
Object
- Object
- Proxy
- Defined in:
- lib/bettercap/monkey/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 16 17 |
# File 'lib/bettercap/monkey/em-proxy/proxy.rb', line 3 def self.start(, &blk) # epoll is not supported on OSX! # EM.epoll EM.run do # We'll take care of this. # # 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
19 20 21 22 |
# File 'lib/bettercap/monkey/em-proxy/proxy.rb', line 19 def self.stop EventMachine.stop rescue end |