Sha256: 0b6e8e856a6f6400e55f9f88d61e556aba9b66ea633132a964d7d839a8cbb052

Contents?: true

Size: 747 Bytes

Versions: 6

Compression:

Stored size: 747 Bytes

Contents

require_relative '../../../lib/cuboid/processes/manager'
require_relative '../../../lib/cuboid/processes/helpers'
require_relative '../../support/helpers/paths'
require_relative 'web_server_manager'
require 'arachni/rpc'

# @note Needs `ENV['WEB_SERVER_DISPATCHER']` in the format of `host:port`.
#
# Exposes the {WebServerManager} over RPC.
#
# @author Tasos "Zapotek" Laskos <tasos.laskos@gmail.com>
class WebServerDispatcher

    def initialize( options = {} )
        host, port = ENV['WEB_SERVER_DISPATCHER'].split( ':' )

        manager = WebServerManager.instance
        manager.address = host

        rpc = Cuboid::RPC::Server.new( host: host, port: port.to_i )
        rpc.add_handler( 'server', manager )
        rpc.run
    end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cuboid-0.0.5 spec/support/lib/web_server_dispatcher.rb
cuboid-0.0.4 spec/support/lib/web_server_dispatcher.rb
cuboid-0.0.3 spec/support/lib/web_server_dispatcher.rb
cuboid-0.0.3alpha spec/support/lib/web_server_dispatcher.rb
cuboid-0.0.2alpha spec/support/lib/web_server_dispatcher.rb
cuboid-0.0.1alpha spec/support/lib/web_server_dispatcher.rb