#!/usr/bin/env ruby

if ARGV.size < 2
  puts "Usage: #{$PROGRAM_NAME} <SOCKS host> <SOCKS port> [script args ...]"
  exit
end

require 'socksify'

TCPSocket.socks_server = ARGV.shift
TCPSocket.socks_port = ARGV.shift.to_i
if ARGV.size >= 1
  load ARGV.shift
else
  require 'irb'
  IRB.start(__FILE__)
end
