Class: Rackdapter::OutboundProxyConnection
- Inherits:
-
EventMachine::Connection
- Object
- EventMachine::Connection
- Rackdapter::OutboundProxyConnection
- Defined in:
- lib/rackdapter/proxy.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ OutboundProxyConnection
constructor
A new instance of OutboundProxyConnection.
- #post_init ⇒ Object
- #receive_data(data) ⇒ Object
- #unbind ⇒ Object
Constructor Details
#initialize(*args) ⇒ OutboundProxyConnection
Returns a new instance of OutboundProxyConnection.
50 51 52 53 54 |
# File 'lib/rackdapter/proxy.rb', line 50 def initialize(*args) @response = args.first @response.client_connection = self super end |
Instance Method Details
#post_init ⇒ Object
56 57 58 |
# File 'lib/rackdapter/proxy.rb', line 56 def post_init @response_buffer = "" end |
#receive_data(data) ⇒ Object
60 61 62 63 64 |
# File 'lib/rackdapter/proxy.rb', line 60 def receive_data(data) # puts "sending to proxy: #{data.inspect}\n---\n" @response_buffer << data @response.send_data(data) end |
#unbind ⇒ Object
66 67 68 |
# File 'lib/rackdapter/proxy.rb', line 66 def unbind @response.close end |