Sha256: c91ad2e65ccdebf63ed44762e8aaf5ce6206ca178fc2caa5df0bbf997d56247f

Contents?: true

Size: 483 Bytes

Versions: 2

Compression:

Stored size: 483 Bytes

Contents

#!/usr/bin/env ruby
# -*- coding: binary -*-
#
# $Revision: 15548 $
#
# $Id: server.rb.ut.rb 15548 2012-06-29 06:08:20Z rapid7 $
#

require 'rex/compat'
require 'rex/proto/tftp'

content = nil

fn = ARGV.shift
if (fn and fn.length > 0)
	File.open(fn, "rb") do |fd|
		content = fd.read(fd.stat.size)
	end
end

content ||= "A" * (1024*1024)


tftp = Rex::Proto::TFTP::Server.new
tftp.register_file("poo", content)
tftp.start

#loop { break if not tftp.thread.alive? }
tftp.thread.join

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
librex-0.0.68 lib/rex/proto/tftp/server.rb.ut.rb
librex-0.0.66 lib/rex/proto/tftp/server.rb.ut.rb