1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
require 'socket'

host = ARGV[0]
port = ARGV[1].to_i

TCPSocket.open(host, port) { |s|
  while $stdin.gets
    s.write $_
    print s.gets
  end
}