Skip to content

WEBBrick binding to localhost instead of all adapters #82

@mjwelchphd

Description

@mjwelchphd

In lib/innate/adapter.rb#self.start_webrick,

      config = {
        :BindAddress => config[:Host],
        :Port => config[:Port],
        :Logger => Log,
      }

should be:

      config = {
        :Host => config[:Host],
        :Port => config[:Port],
        :Logger => Log,
      }

because Rack expects to find it there and moves it to :BindAddress in
lib/rack/handler/webrick.rb#self.run, as you can see below:

      def self.run(app, options={})
        environment  = ENV['RACK_ENV'] || 'development'
        default_host = environment == 'development' ? 'localhost' : '0.0.0.0'

        options[:BindAddress] = options.delete(:Host) || default_host
        options[:Port] ||= 8080
        @server = ::WEBrick::HTTPServer.new(options)
        @server.mount "/", Rack::Handler::WEBrick, app
        yield @server  if block_given?
        @server.start
      end

What this means is, if you're running Ramaze on a remote server, the bug causes the :BindAddress to default to localhost, so your browser won't see the site.

2016-05-12 Fixed in Innate PR 754a7a7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions