1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-11-05 14:57:30 +01:00

Fixes #397. Webrick requires :BindAddress but msfweb only passed in :Host, likely an api change was missed during a rails upgrade.

git-svn-id: file:///home/svn/framework3/trunk@7277 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
HD Moore 2009-10-26 17:33:05 +00:00
parent 0a6bb91cb9
commit e7638ef887
2 changed files with 10 additions and 13 deletions

View File

@ -25,7 +25,7 @@ ARGV.clone.options do |opts|
opts.on("-p", "--port=port", Integer,
"Runs Rails on the specified port.", "Default: 3000") { |v| options[:Port] = v }
opts.on("-b", "--binding=ip", String,
"Binds Rails to the specified ip.", "Default: 0.0.0.0") { |v| options[:Host] = v }
"Binds Rails to the specified ip.", "Default: 0.0.0.0") { |v| options[:BindAddress] = options[:Host] = v }
opts.on("-c", "--config=file", String,
"Use custom rackup configuration file") { |v| options[:config] = v }
opts.on("-d", "--daemon", "Make server run as a Daemon.") { options[:detach] = true }

21
msfweb
View File

@ -38,7 +38,7 @@ background = false
browser_start = false
# Parse command line arguments.
arguments.parse(ARGV) { |opt, idx, val|
arguments.parse(ARGV) do |opt, idx, val|
case opt
when "-a"
opts['ServerHost'] = val
@ -56,23 +56,20 @@ arguments.parse(ARGV) { |opt, idx, val|
arguments.usage)
exit
end
}
end
# Drain ARGV
while(ARGV.shift) do
end
# This is stupid, but we need to override the ARGV constant
ostderr = $stderr
$stderr = StringIO.new
ARGV = [
# Rebuild ARGV
ARGV.unshift([
'-p', opts['ServerPort'],
'-b', opts['ServerHost'],
'-e', 'production',
(background ? '-d' : '')
]
$stderr.close
$stderr = ostderr
])
ARGV.flatten!
$browser_url = "http://#{opts['ServerHost']}:#{opts['ServerPort']}/"
$browser_start = browser_start