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/ssl_transparent_proxy.rb, line 19 def initialize(tcpsocket, client_conn, ctx) super(tcpsocket) @client = client_conn @ctx = ctx @connected = false @closed = false sni_hostname = @client.dest_hostname if @client.dest_hostname end
Transmit data sent by the destinaton to the client.
# File lib/packetthief/handlers/ssl_transparent_proxy.rb, line 40 def receive_data(data) @client.dest_recv(data) end
# File lib/packetthief/handlers/ssl_transparent_proxy.rb, line 35 def tls_failed_handshake(e) @client.dest_handshake_failed(e) end
send on successful handshake instead of on post_init.
# File lib/packetthief/handlers/ssl_transparent_proxy.rb, line 30 def tls_successful_handshake @client.dest_connected @client._send_buffer end
Start the closing process and close the other connection if it is not already closing.
# File lib/packetthief/handlers/ssl_transparent_proxy.rb, line 46 def unbind @client.dest_closed self.closed = true @client.dest = nil @client.close_connection_after_writing if @client and not @client.closed end