Within the file dispatcher.rb
------------------------------------------
# Adding for using SSL
require 'net/https'
def invoke
# TODO: should be added some request headers 2006/10/12 shino
# e.g. X-Ap4r-Version, Accept(need it?)
# TODO: Now supports POST only, 2006/10/12 shino
@response = nil
uri = URI.parse(@message[:target_url])
headers = make_header
# TODO: SUPPORT SSL
# Check if SSL is to be used
if uri.port == @conf['ssl_port']
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.start do |http|
@response, = http.post(uri.path, @message.object, headers)
end
else
Net::HTTP.start(uri.host, uri.port) do |http|
# TODO: global configuration over dispatchers for each protocol should be considered, 2008/02/06 by kiwamu
# TODO: http open timeout should be considered, 2008/02/06 by kiwamu
if @conf['http'] && @conf['http']['timeout']
http.read_timeout = @conf['http']['timeout']
logger.info "set HTTP read timeout to #{http.read_timeout}s"
end
@response, = http.post(uri.path, @message.object, headers)
end
end # if SSL
end
Within the file queues.cfg
------------------------------------------
dispatchers:
-
targets: queue.*
threads: 1
ssl_port: 443
|