# -*- encoding: binary -*- require 'uri' require 'rack' require 'thread' require 'sequel' require 'http_spew' require 'rpatricia' # The Regurgitator main module, serving as a namespace for all # modules and classes. # # All modules meant for use in applications are autoload-ed, # so just "require 'regurgitator'" in your code. module Regurgitator # This HTTP header is read to determine a location to reproxy to. # Add this header in your nginx config. REPROXY_KEY = 'HTTP_X_REPROXY_PATH' autoload :ServerSettings, 'regurgitator/server_settings' autoload :Domain, 'regurgitator/domain' autoload :Device, 'regurgitator/device' autoload :FileInfo, 'regurgitator/file_info' autoload :Endpoint, 'regurgitator/endpoint' autoload :FileRequest, 'regurgitator/file_request' autoload :Local, 'regurgitator/local' autoload :LocalFile, 'regurgitator/local_file' # Rack middlewares/apps autoload :DomainPath, 'regurgitator/domain_path' autoload :DomainHost, 'regurgitator/domain_host' autoload :OneDomain, 'regurgitator/one_domain' # used to wrap up all Regurgitator-specific extensions class Error < StandardError; end # raised when there are no readable devices class NoDevices < Error; end # raised by FileRequest when the HTTP status code # is outside of (200-299, 304) class BadResponse < Error; end end