class PacketThief::Handlers::ProxyRedirector

Instead of forwarding the connection to the original host, forwards it to a configured host instead.

Public Class Methods

new(proxy_host, proxy_port, log=nil) click to toggle source
# File lib/packetthief/handlers/proxy_redirector.rb, line 8
def initialize(proxy_host, proxy_port, log=nil)
  super(log)

  @proxy_host = proxy_host
  @proxy_port = proxy_port
end

Public Instance Methods

client_connected() click to toggle source

Instead of using the original destination, use the configured destination.

# File lib/packetthief/handlers/proxy_redirector.rb, line 16
def client_connected
  @dest_host = @proxy_host
  @dest_port = @proxy_port
  connect_to_dest
end