Represents a connection out to the original destination.
Boolean that represents whether this handler has started to close/unbind. Used to ensure there is no unbind-loop between the two connections that make up the proxy.
Boolean that represents whether the connection has connected yet.
Sets up references to the client proxy connection handler that created this handler.
# File lib/packetthief/handlers/transparent_proxy.rb, line 20 def initialize(client_conn) @client = client_conn @connected = false @closing = false end
# File lib/packetthief/handlers/transparent_proxy.rb, line 27 def post_init @client._send_buffer end
Transmit data sent by the destinaton to the client.
# File lib/packetthief/handlers/transparent_proxy.rb, line 32 def receive_data(data) @client.dest_recv(data) end
Start the closing process and close the other connection if it is not already closing.
# File lib/packetthief/handlers/transparent_proxy.rb, line 38 def unbind @client.dest_closed self.closing = true @client.close_connection_after_writing if @client and not @client.closing end