Class: SSLGate::RawServer
- Inherits:
-
EM::Connection
- Object
- EM::Connection
- SSLGate::RawServer
- Defined in:
- lib/ssl_gate/raw_gate.rb
Direct Known Subclasses
Class Attribute Summary collapse
-
.add_ons ⇒ Object
Returns the value of attribute add_ons.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(config) ⇒ RawServer
constructor
A new instance of RawServer.
- #post_init ⇒ Object
- #receive_data(data) ⇒ Object
- #unbind ⇒ Object
Constructor Details
#initialize(config) ⇒ RawServer
Returns a new instance of RawServer.
38 39 40 |
# File 'lib/ssl_gate/raw_gate.rb', line 38 def initialize(config) @config = config end |
Class Attribute Details
.add_ons ⇒ Object
Returns the value of attribute add_ons.
31 32 33 |
# File 'lib/ssl_gate/raw_gate.rb', line 31 def add_ons @add_ons end |
Class Method Details
.start(config) ⇒ Object
34 35 36 |
# File 'lib/ssl_gate/raw_gate.rb', line 34 def self.start(config) EventMachine.start_server (config[:bind_interface] || '0.0.0.0'), config[:bind_port], self, config end |
Instance Method Details
#post_init ⇒ Object
42 43 44 45 46 |
# File 'lib/ssl_gate/raw_gate.rb', line 42 def post_init @queue = EM::Queue.new uri = URI.parse @config[:target] EM.connect uri.host, uri.port, RawClient, @queue, self end |
#receive_data(data) ⇒ Object
48 49 50 |
# File 'lib/ssl_gate/raw_gate.rb', line 48 def receive_data(data) @queue.push data end |
#unbind ⇒ Object
52 53 54 |
# File 'lib/ssl_gate/raw_gate.rb', line 52 def unbind @queue.push nil end |