From ef8ebe0df4da0a0cd2f599308f40bd707ab18d92 Mon Sep 17 00:00:00 2001 From: Rick Bradley Date: Mon, 15 Oct 2007 15:04:10 -0500 Subject: Implementing address & port support for new webrick server. --- lib/puppet/network/http/webrick.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/puppet/network') diff --git a/lib/puppet/network/http/webrick.rb b/lib/puppet/network/http/webrick.rb index c22bce938..b74bf441e 100644 --- a/lib/puppet/network/http/webrick.rb +++ b/lib/puppet/network/http/webrick.rb @@ -1,7 +1,7 @@ require 'webrick' require 'webrick/https' -class Puppet::Network::HTTP::WEBrick < WEBrick::HTTPServer +class Puppet::Network::HTTP::WEBrick def initialize(args = {}) @listening = false end @@ -12,8 +12,12 @@ class Puppet::Network::HTTP::WEBrick < WEBrick::HTTPServer raise ArgumentError, ":port must be specified." unless args[:port] raise "WEBrick server is already listening" if listening? - # TODO / FIXME: this should be moved out of the wacky Puppet global namespace! + @server = WEBrick::HTTPServer.new(:BindAddress => args[:address], :Port => args[:port]) + + # TODO / FIXME is this really necessary? -- or can we do it in both mongrel and webrick? + Puppet.newservice(@server) Puppet.start + @listening = true end -- cgit