 
 _ = require "underscore"
 logger = require "winston"
+events = require "events"
 colors = require "colors"
 util = require "util"
 url = require "url"

# and processing logic based on domain matches and RE match/extract
# logics, to deal with paths. Remember that this service is just a
# an internal base class, you generally should not use it directly.
module.exports.Service = class Service extends Object

    # Here follows a set of definitions that predefine the usual
    # suspects in establishing the matching patterns. Basically,

        notRegexp = "The #{inspected} is not a valid regular expression"
        throw new Error(notRegexp) unless _.isRegExp(pattern)
        (@domains ?= []) push pattern unless duplicate
        (logger.info(associate.cyan) unless duplicate); this

    # This method determines whether the supplied HTTP request
    # matches this service. This is determined by examining the
