#!/usr/bin/env ruby

require 'rubygems'
require 'net/ssh'
require 'net/ssh/proxy/command'

host="github.com"
user="git"
proxy = Net::SSH::Proxy::Command.new('nc %h %p')
options = {:paranoid => false, :verbose => Logger::DEBUG, :proxy => proxy}

Net::SSH.start(host, user, options) do |session|
  session.open_channel do |channel|

    channel.on_extended_data do |ch, type, data|
      next unless type == 1
      warn data
    end

    channel.send_channel_request "shell"
  end

  session.loop
end

