Class: Rackdapter::OutboundProxyConnection

Inherits:
EventMachine::Connection
  • Object
show all
Defined in:
lib/rackdapter/proxy.rb

Instance Method Summary collapse

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_initObject



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

#unbindObject



66
67
68
# File 'lib/rackdapter/proxy.rb', line 66

def unbind
  @response.close
end